Docs menu
Consent Mode v2
Google Consent Mode v2 in CookieHug: how it works, basic vs advanced, category-to-signal mapping, regional defaults and diagnostics.
Google Consent Mode v2
CookieHug automatically integrates with Google Consent Mode v2. No additional configuration is needed.
What Consent Mode is (and is not). Consent Mode is a Google mechanism for signalling to Google tags how they should behave based on the user's choices — a technical signalling layer between your consent banner and Google's products. It is not a legal or regulatory compliance solution and is not intended to satisfy any particular privacy regulation on its own. Meeting the requirements of any specific law is the responsibility of the site owner and their consent policy; Consent Mode only relays the resulting signals.
How It Works
- On page load — CookieHug sends a
gtag('consent', 'default', ...)command denying all consent types for EEA countries, withwait_for_update: 2000(2 seconds for the banner to load before Google tags fire with default denied state) - After user consent — CookieHug sends
gtag('consent', 'update', ...)with the user's choices - On return visits — saved consent is restored automatically
Basic vs Advanced configuration
Consent Mode can be deployed in two configurations. The difference is whether Google tags are blocked from loading before the user consents. CookieHug supports both from the GUI.
| Basic | Advanced (CookieHug default) | |
|---|---|---|
| Google tag loads before consent? | No — the tag is blocked until consent | Yes — the tag loads immediately |
| Before consent | Nothing loads, no pings sent | Tag runs with all signals denied, sends cookieless pings |
| After consent | The tag is unblocked and loads | gtag('consent','update') flips the signals; behavioural modelling applies |
| Data recovery / modelling | None before consent | Conversion & behavioural modelling from the denied pings |
Advanced (default): leave Consent Mode enabled and do not block the Google tag with CookieHug's script blocker — the tag loads on every page and gtag('consent','default', denied) (which CookieHug emits before the tag) keeps it privacy-safe until the user acts. This is the configuration Google's advanced guide describes.
Basic: let CookieHug block the Google tag until consent — either keep data-cookiehug-blockingmode="auto" (the tag matches a tracking pattern and is held) or explicitly tag it with data-cookiehug-consent so it only executes after acceptance. No tag and no ping fire before the user consents.
Category Mapping
| CookieHug Category | Google Consent Mode Parameters |
|---|---|
| Necessary | security_storage: 'granted' (always) |
| Statistics | analytics_storage |
| Marketing | ad_storage, ad_user_data, ad_personalization |
| Preferences | functionality_storage, personalization_storage |
Additional GCM Features
CookieHug automatically enables:
- URL passthrough (
url_passthrough: true) — preserves ad click information in URLs - Ads data redaction (
ads_data_redaction: true) — redacts ad data when consent is denied
Disabling Google Consent Mode
If you manage Google Consent Mode separately, you can disable CookieHug's GCM integration:
<script
data-cookiehug-consentmode="disabled"
src="https://cookiehug.com/api/script/YOUR-LICENSE-KEY.js">
</script>Regional defaults & precedence (Sprint 1)
Each domain can configure per-region defaults for the four Google signals (ad_storage, ad_user_data, ad_personalization, analytics_storage). Region is detected from CF-IPCountry / CF-Region-Code (Cloudflare). Lookup precedence: exact match (e.g. US-CA) → parent region (US) → ROW fallback → global defaults. Configure under Domain detail → tab Google Consent Mode.
Change in Google Signals meaning
Disabling a signal in categoryMapping does not stop Google from receiving traffic — it sets the signal to "denied", which Google honours by switching the related product into a privacy-preserving mode (modeled conversions, cookieless pings). To fully disable a Google product, remove the tag from your site; CookieHug only controls consent state, not tag presence.
Diagnostics panel
Domain detail → tab Diagnostics runs an auto-checklist (default before tags, update after decision, region matched, final ad/analytics storage, Ads/GA4 mappings) for any combination of simulated region + simulated user action.