Control when non-essential scripts can run.
CookieHub controls when analytics, marketing and other consent-dependent scripts are allowed to run, based on the visitor’s choices and your consent setup.
Keep consent-dependent scripts under control.
Analytics, marketing and other non-essential scripts can set cookies and send data as soon as a page loads. Where consent is required, CookieHub holds them back until the visitor chooses, so what runs follows the visitor’s choices and your consent setup.
Consent modelsPrivacy regulations- Before a choiceScripts assigned to non-essential categories are held when the page loads.
- After a choiceScripts run only for the categories the visitor allows.
- When preferences changeThe new choice applies from then on: scripts load only for allowed categories, and supported consent signals are updated.
Which categories need consent first depends on the regulations that cover your visitors.
How CookieHub blocks scripts until consent.
- 01
Scan your website
The cookie scanner finds the cookies and scripts your pages use, and can rescan on a schedule.
- 02
Assign categories
Known cookies are sorted into categories and anything unrecognised is flagged for review. Supported common services have built-in blocking rules; you assign other scripts to a category yourself.
- 03
Hold when consent is required
Based on the configured consent model, scripts in non-essential categories are held until the visitor allows their category.
- 04
Apply the choice
Scripts run for the categories the visitor allows, and supported consent signals are updated.
Control scripts by consent category.
Scripts can be assigned to categories such as Necessary, Preferences, Analytics or Marketing. CookieHub uses the visitor’s category choices to control relevant scripts according to the configured consent setup.
- Automatic blockingWhere consent is required, supported common services are blocked automatically when CookieHub is installed as an HTML tag.
- Tag manager supportInstalled through Google Tag Manager or Matomo Tag Manager, your tags fire through CookieHub’s consent triggers.
- JavaScript APICheck a category with hasConsented() before loading a script of your own.
- Choice by categoryVisitors accept everything, decline or choose category by category.
- NecessaryAlways onRequired for the site to work.
- AnalyticsHelps measure how the site is used.
- MarketingUsed to personalise advertising.
- PreferencesRemembers settings such as language.
What runs before and after a visitor chooses.
Script behaviour depends on your consent setup and the visitor’s current choices. Where prior consent is required, relevant non-essential scripts can remain restricted until the visitor allows their category.
- Necessary scripts always run
- Consent-dependent scripts can wait where prior consent is required
- Declined categories stay blocked
- Visitors can update their preferences later
gtag('consent','default',{ analytics_storage:'denied', ad_storage:'denied', ad_user_data:'denied', ad_personalization:'denied' })Script blocking and consent signals work together.
Script blocking controls whether consent-dependent scripts can run. Consent signals communicate the visitor’s current consent state to supported platforms and frameworks. CookieHub keeps both aligned as choices change.
- Visitor choiceAccept, decline or choose by category
- CookieHubApplies the consent state
- Scripts and signalsScripts held or allowed, supported signals updated
Script blocking is one part of your consent setup.
CookieHub brings scanning, consent collection, script control and consent records together in one platform, so your consent setup stays connected.
Script blocking questions, answered.
Script blocking controls when non-essential scripts, such as analytics and marketing tags, are allowed to run. Where your consent setup requires prior consent, they are held until the visitor allows their category.
Scripts you assign to a category follow your configured consent model. Where prior consent is required, they are held until the visitor allows that category. With CookieHub installed as an HTML tag near the top of the page, automatic cookie blocking holds supported common services. Other scripts need a custom blocking rule or a data-consent category in your code, or they load through Google Tag Manager or Matomo Tag Manager with CookieHub’s consent triggers.
Scripts in the Necessary category always run. Whether Preferences, Analytics and Marketing scripts run before a choice depends on your consent setup; where prior consent is required, they wait for it.
Yes, through consent triggers. When CookieHub is installed through Google Tag Manager or Matomo Tag Manager, load your tracking tags in the tag manager and fire them with CookieHub’s consent triggers so they follow the visitor’s choice. Automatic cookie blocking isn’t available with a Google Tag Manager install, so tags there rely on those triggers and, for Google tags, Google Consent Mode v2.
The new choice replaces the previous one and applies from then on: consent-dependent scripts load only for allowed categories, and supported consent signals such as Google Consent Mode are updated. Withdrawing consent doesn’t unload a script that has already run on the page, so use the onRevoke event to stop services you start in code. With automatic cookie removal on, cookies in categories the visitor no longer allows are removed.
No, they work together. Script blocking controls which scripts run, while Google Consent Mode v2 passes the consent state to Google tags and updates it when a visitor changes it.
No tool can guarantee legal compliance on its own. Script blocking supports your consent setup alongside a clear consent banner and consent records; which requirements apply, and how you configure CookieHub to meet them, remains your responsibility.
Keep consent-dependent scripts aligned with visitor choices.
Control consent-dependent scripts from the same platform that collects, applies and records visitor choices.