Summary
Since March 2024, Google has required Consent Mode v2 signals for EEA traffic when you use Google Ads measurement, remarketing or ad personalisation, including GA4 data linked to Google Ads. This playbook walks you through implementation with your existing CMP. For how the consent signals and basic vs advanced modes work, read the Google Consent Mode v2 guide first.
Prerequisites Checklist
- Google tag (gtag.js) or GTM installed
- CMP displaying consent banner
- Access to edit website code or GTM
- Test environment available
Decision Tree
Do you use Google Tag Manager?
├── YES → Use GTM Consent Mode template
│ └── Does your CMP have GTM integration?
│ ├── YES → Use CMP's GTM template
│ └── NO → Use manual dataLayer implementation
└── NO → Implement directly in gtag.js
└── Does your CMP support Consent Mode?
├── YES → Enable in CMP settings
└── NO → Implement custom JavaScript bridge
Implementation Steps
Step 1: Set Default Consent State
Add this code before any Google tags load:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'functionality_storage': 'denied',
'personalization_storage': 'denied',
'security_storage': 'granted',
'wait_for_update': 500,
'region': [
'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR',
'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL',
'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'IS', 'LI', 'NO',
'GB', 'CH'
]
});
The region key takes ISO 3166-2 country codes, so values such as ‘EU’ or ‘EEA’ are not valid. This list covers the EEA countries plus the UK and Switzerland. Remove the key if you want the denied default to apply to every visitor.
Time estimate: 5-10 minutes
Step 2: Configure Consent Updates
When user grants consent, update the state:
gtag('consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
});
Time estimate: 10-20 minutes
Step 3: Connect Your CMP
For Cookiebot:
- Go to Cookiebot dashboard → Settings → Google Consent Mode
- Enable “Google Consent Mode v2”
- Map consent categories to Google consent types
- Save and republish
For Usercentrics:
- Go to Admin Interface → Implementation
- Enable “Google Consent Mode”
- Configure consent type mappings
- Deploy updated script
In Google Tag Manager:
- Go to Admin → Container Settings and tick “Enable consent overview”
- Add your CMP’s template from the Community Template Gallery (Cookiebot and Usercentrics both publish one), set all four consent types to denied as the default, and fire it on the Consent Initialization - All Pages trigger
- Open Tags → Consent Overview and confirm each Google tag shows its built-in consent checks; add consent requirements to non-Google tags
- In Preview mode, select the first event, open the Consent tab and confirm the On-page Default shows denied, then check the On-page Update after you click accept or reject
Time estimate: 10-15 minutes
Step 4: Enable Advanced Features (Optional)
gtag('set', 'url_passthrough', true);
gtag('set', 'ads_data_redaction', true);
Time estimate: 5 minutes
Step 5: Verify Implementation
- Open Chrome DevTools → Console
- Type:
dataLayer.filter(e => e[0] === 'consent') - Verify default and update events appear
- Use Google Tag Assistant to validate
Time estimate: 10-15 minutes
Failure Modes
Consent Mode not firing
Symptom: No consent events in dataLayer
Cause: Script loading order issue
Fix: Ensure consent default is set before gtag loads. Use async loading for gtag but sync for consent default.
CMP not updating consent
Symptom: Default state never changes to granted
Cause: CMP callback not connected
Fix: Check CMP documentation for consent callback. Verify event listener is properly configured.
Region detection not working
Symptom: All users see consent banner (or none do)
Cause: Geo-detection misconfigured
Fix: Verify CMP geo-detection settings. Consider using server-side detection for accuracy.
Downloadable Resources
Related Playbooks
Sources
Disclosure: We may earn a commission if you sign up for recommended tools through our links. This never affects our recommendations or methodology.