Google Consent Mode v2
What This Means
Google Consent Mode v2 is Google's updated framework for adapting Google tag behavior based on user consent choices. Starting March 2024, it's required for using Google Ads remarketing and audience features in the EEA/UK.
Key Changes in v2:
- Two new parameters:
ad_user_dataandad_personalization - Required for EEA/UK remarketing and similar audiences
- Impacts data collection and modeling capabilities
Impact Assessment
Business Impact
- Critical for EU/UK Markets: Required for remarketing and audience building
- Data Gaps: Non-consented users create measurement gaps
- Modeling Dependency: Behavioral modeling fills gaps but requires sufficient data
Technical Impact
- Tag Updates Required: All Google tags need v2 parameter support
- CMP Integration: Consent Management Platform must send new signals
- GTM Configuration: Server-side and client-side updates needed
How to Diagnose
Check Current Implementation
Browser Console Test:
// Check consent state
console.log('Consent state:',
window.dataLayer?.filter(e => e[0] === 'consent')
);
GTM Preview Mode:
- Open GTM Preview
- Look for Consent Initialization trigger
- Verify consent parameters are set
Required Parameters
| Parameter | Purpose | Values |
|---|---|---|
ad_storage |
Advertising cookies | granted/denied |
analytics_storage |
Analytics cookies | granted/denied |
ad_user_data |
NEW User data for ads | granted/denied |
ad_personalization |
NEW Personalized ads | granted/denied |
Validation Checklist
- Default consent set before Google tags load
- All four parameters included
- CMP correctly updates consent state
- Consent persists across pages
- Server-side GTM handles consent (if applicable)
General Fixes
1. Update Default Consent Settings
// Set default consent BEFORE gtag loads
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',
'wait_for_update': 500 // Wait for CMP
});
2. Update Consent on User Choice
// When user grants consent
gtag('consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
});
3. GTM Implementation
Consent Initialization Tag:
// In GTM custom HTML tag (Consent Initialization trigger)
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Default: denied for EEA users
var isEEA = {{DLV - User Region}} === 'EEA';
gtag('consent', 'default', {
'ad_storage': isEEA ? 'denied' : 'granted',
'ad_user_data': isEEA ? 'denied' : 'granted',
'ad_personalization': isEEA ? 'denied' : 'granted',
'analytics_storage': isEEA ? 'denied' : 'granted',
'region': ['EEA'] // Apply to EEA only
});
</script>
4. CMP Integration Example
OneTrust Example:
// OneTrust callback to update consent
window.OneTrust?.OnConsentChanged(() => {
const groups = window.OnetrustActiveGroups || '';
gtag('consent', 'update', {
'ad_storage': groups.includes('C0004') ? 'granted' : 'denied',
'ad_user_data': groups.includes('C0004') ? 'granted' : 'denied',
'ad_personalization': groups.includes('C0004') ? 'granted' : 'denied',
'analytics_storage': groups.includes('C0002') ? 'granted' : 'denied'
});
});
Cookiebot Example:
// Cookiebot callback
window.addEventListener('CookiebotOnAccept', function() {
gtag('consent', 'update', {
'ad_storage': Cookiebot.consent.marketing ? 'granted' : 'denied',
'ad_user_data': Cookiebot.consent.marketing ? 'granted' : 'denied',
'ad_personalization': Cookiebot.consent.marketing ? 'granted' : 'denied',
'analytics_storage': Cookiebot.consent.statistics ? 'granted' : 'denied'
});
});
5. Enable Behavioral Modeling
To compensate for consent gaps:
- Go to Google Analytics 4 > Admin > Data Settings
- Enable Consent Mode modeling
- Ensure sufficient traffic (1000+ events/day) for modeling
Advanced Mode vs Basic Mode
Advanced Mode (Recommended)
- Tags load with consent denied
- Cookieless pings sent
- Enables behavioral modeling
- Better data completeness
Basic Mode
- Tags blocked until consent
- No cookieless pings
- Less data for modeling
- Simpler implementation
Platform-Specific Guides
| Platform | Guide |
|---|---|
| Shopify | Shopify Consent Mode |
| WordPress | WordPress Consent Mode |
| Wix | Wix Consent Mode |
Testing Your Implementation
Google Tag Assistant
- Install Google Tag Assistant
- Record a session
- Verify consent events fire correctly
- Check parameter values match user choice
Chrome DevTools
// Monitor consent updates
const observer = new MutationObserver(() => {
const consentEvents = dataLayer.filter(e => e[0] === 'consent');
console.table(consentEvents);
});
Real-Time Reports
- Open GA4 Real-Time report
- Trigger consent changes
- Verify events appear correctly
- Check modeling indicators
Common Issues
Consent Not Persisting
Tags Still Firing Without Consent
- Verify tag sequencing in GTM
- Check for hardcoded gtag.js
- Review third-party integrations
Modeling Not Working
- Confirm Advanced Mode is active
- Verify sufficient traffic volume
- Allow 30+ days for modeling data
Compliance Timeline
| Date | Requirement |
|---|---|
| March 2024 | Required for EEA remarketing |
| Ongoing | Required for new Google Ads features |