Google Consent Mode v2
Google Consent Mode v2 allows Google services such as Google Analytics, Google Ads, and Floodlight to adjust their behavior based on user consent choices. It helps website owners comply with data protection laws by informing Google how to operate before and after a user makes a consent decision.
CookieHub integrates with Consent Mode v2 automatically and sets all required consent signals based on the user’s preferences.
What does Google Consent Mode v2 do?
Consent Mode v2 sets parameters that determine how Google tags behave depending on user consent. These parameters are passed directly to Google through the gtag
or Google Tag Manager (GTM).
The following parameters are used:
Parameter | Purpose |
---|---|
ad_storage | Controls storage of advertising cookies |
analytics_storage | Controls storage of analytics cookies |
functionality_storage | Controls storage for non-essential functional features |
security_storage | Controls security-related cookie storage |
ad_user_data | Controls whether user data can be sent to Google for advertising |
ad_personalization | Controls whether ads can be personalized |
CookieHub automatically maps these parameters to the appropriate cookie categories in your configuration.
CookieHub integration
CookieHub fully supports Consent Mode v2 and sets the required parameters automatically based on user consent.
- No manual configuration of the
gtag
is needed. - Consent signals are passed to Google automatically.
- Works in both HTML and Google Tag Manager (GTM) implementations.
Implementation methods
HTML implementation
When CookieHub is installed directly in your site’s HTML (using the embed script in the <head>
), Google Consent Mode is fully supported. Parameters are set automatically before any Google tags execute.
No further setup is needed if tags are placed after the CookieHub script.
Google Tag Manager (GTM) implementation
If you’re using GTM, CookieHub provides a built-in GTM template that enables full Consent Mode support.
To enable it:
- Go to your GTM container
- Add a new tag and choose the CookieHub CMP from the Community Template Gallery
- Enter your CookieHub domain code
- Set the trigger to Consent Initialization - All Pages
- Save and publish
This ensures that Consent Mode is initialized before any tags run, and user preferences are respected.
You must configure additional consent control manually for non-Google tags that do not support Consent Mode. See Installation: Additional Consent.
Parameter mapping
CookieHub maps internal cookie categories to Consent Mode parameters as follows:
CookieHub Category | Consent Mode Parameter |
---|---|
Marketing | ad_storage , ad_user_data , ad_personalization |
Analytics | analytics_storage |
Preferences | functionality_storage |
Necessary | security_storage (always allowed) |
These parameters are updated automatically when the user gives or withdraws consent.
When is Google Consent Mode v2 required?
Consent Mode v2 is required if:
- You use Google Ads, AdSense, or Google Analytics in the EU, UK, or Switzerland
- You are subject to the Google EU User Consent Policy
- You want to collect analytics or conversion data in compliance with privacy laws
Summary
Feature | CookieHub Support |
---|---|
Consent Mode v2 integration | ✅ Yes |
HTML script integration | ✅ Yes |
GTM integration with template | ✅ Yes |
Parameter mapping to categories | ✅ Yes |