Consent Mode v2 is Google’s framework for adjusting how Google tags behave based on user consent choices. It allows you to maintain measurement capabilities while respecting privacy regulations like GDPR and CCPA.
As of March 2024, Consent Mode v2 is required for advertisers using Google Ads in the European Economic Area (EEA). Without proper implementation, remarketing audiences stop populating and conversion measurement degrades significantly.
This guide walks through the complete implementation process in Google Tag Manager.
What Is Consent Mode v2?
Consent Mode is a communication layer between your consent management platform (CMP) and Google tags. It tells Google tags what type of consent the user has granted or denied.
How It Works
- User lands on your website
- Your consent banner appears
- User makes consent choices (accept, reject, customize)
- Consent Mode communicates these choices to Google tags
- Google tags adjust their behavior based on consent state
What Changed in v2
Consent Mode v2 introduced two new consent parameters:
ad_user_data: Controls whether user data can be sent to Google for advertising purposes.
ad_personalization: Controls whether personalized advertising is allowed.
These join the original parameters:
analytics_storage: Controls Google Analytics cookies.
ad_storage: Controls advertising cookies (Google Ads, Floodlight).
All four parameters must be implemented for full Consent Mode v2 compliance.
Why Consent Mode v2 Matters
Regulatory Compliance
GDPR, ePrivacy Directive, and similar regulations require explicit consent before setting non-essential cookies. Consent Mode ensures Google tags respect these requirements.
Continued Measurement
Without Consent Mode, denied consent means zero data. With Consent Mode, Google uses conversion modeling to estimate conversions from users who declined consent. You maintain directional measurement without violating privacy.
Google Ads Requirements
For EEA traffic, Google requires Consent Mode v2 implementation to:
- Build remarketing audiences
- Measure conversions accurately
- Use Smart Bidding effectively
Without it, your Google Ads campaigns in Europe operate blind.
Consent Mode States Explained
Each consent parameter can be in one of two states:
Granted
User consented to this type of tracking. Tags behave normally.
ad_storage: 'granted'
analytics_storage: 'granted'
ad_user_data: 'granted'
ad_personalization: 'granted'
Denied
User did not consent (or has not yet responded). Tags adjust behavior:
- No cookies are written
- No identifiers are stored
- Pings are sent without user identification
- Google models conversions statistically
ad_storage: 'denied'
analytics_storage: 'denied'
ad_user_data: 'denied'
ad_personalization: 'denied'
Implementation Overview
Consent Mode v2 implementation involves three components:
- Default consent state: Set before any tags fire
- Consent update: Triggered when user makes a choice
- Tag configuration: Ensure tags respect consent state
The implementation method depends on your consent management platform.
Method 1: Using a Google-Certified CMP with Built-In Support
Many consent management platforms have native Consent Mode v2 integration.
Supported CMPs Include:
- Cookiebot
- OneTrust
- Usercentrics
- Didomi
- CookieYes
- Termly
- iubenda
- Osano
Implementation Steps
Step 1: Enable Consent Mode in Your CMP
Each CMP has different settings. Generally:
- Log into your CMP dashboard
- Find the Google Consent Mode settings
- Enable Consent Mode v2
- Map your consent categories to Google’s parameters:
- Marketing/Advertising → ad_storage, ad_user_data, ad_personalization
- Analytics/Statistics → analytics_storage
- Save configuration
Step 2: Add CMP Tag in GTM
Most CMPs provide a GTM template:
- In GTM, go to Templates → Search Gallery
- Search for your CMP (e.g., “Cookiebot”)
- Add the template to your workspace
- Create a new tag using the template
- Configure with your CMP account ID
- Set trigger to “Consent Initialization - All Pages”
The “Consent Initialization” trigger fires before all other triggers, ensuring consent state is set first.
Step 3: Enable Consent Overview in GTM
- Go to Admin → Container Settings
- Enable “Enable consent overview”
- Save
This shows consent status for each tag in your container.
Step 4: Configure Tag Consent Settings
For each Google tag, verify consent settings:
- Open the tag
- Go to Advanced Settings → Consent Settings
- Set “Built-in Consent Checks” or specify required consent types
- Save
Google tags (GA4, Google Ads) have built-in consent checks. They automatically respect Consent Mode states.
Step 5: Test the Implementation
- Open GTM Preview Mode
- Load your site
- Check that consent defaults are set before tags fire
- Accept consent in the banner
- Verify consent updates to “granted”
- Verify tags fire after consent is granted
Method 2: Manual Implementation with gtag.js
If your CMP does not have built-in Consent Mode support, implement manually.
Step 1: Set Default Consent State
Create a Custom HTML tag that sets the default state before any other tags fire.
- Go to Tags → New
- Name it “Consent Mode - Default State”
- Select “Custom HTML”
- Enter:
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Set default consent state - denied until user consents
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'wait_for_update': 500 // Wait 500ms for consent banner response
});
// Optional: Set default for specific regions only
// gtag('consent', 'default', {
// 'ad_storage': 'denied',
// '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']
// });
</script>
- Set trigger to “Consent Initialization - All Pages”
- Save
Step 2: Create Consent Update Function
Create a tag that updates consent when the user makes a choice.
- Go to Tags → New
- Name it “Consent Mode - Update Function”
- Select “Custom HTML”
- Enter:
<script>
// Function to update consent state
window.updateConsent = function(consentSettings) {
gtag('consent', 'update', consentSettings);
// Push event for GTM triggers
window.dataLayer.push({
'event': 'consent_update',
'consent_analytics': consentSettings.analytics_storage,
'consent_ads': consentSettings.ad_storage,
'consent_ad_user_data': consentSettings.ad_user_data,
'consent_ad_personalization': consentSettings.ad_personalization
});
};
</script>
- Set trigger to “Consent Initialization - All Pages”
- Save
Step 3: Connect Your Consent Banner
Your consent banner must call the update function when the user makes a choice.
When user accepts all:
window.updateConsent({
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
});
When user rejects all:
window.updateConsent({
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
When user makes custom choices:
window.updateConsent({
'ad_storage': userAcceptedMarketing ? 'granted' : 'denied',
'ad_user_data': userAcceptedMarketing ? 'granted' : 'denied',
'ad_personalization': userAcceptedMarketing ? 'granted' : 'denied',
'analytics_storage': userAcceptedAnalytics ? 'granted' : 'denied'
});
Step 4: Handle Returning Users
If a user previously consented, restore their consent state on page load:
// Check stored consent preference
var storedConsent = localStorage.getItem('user_consent');
if (storedConsent) {
var consent = JSON.parse(storedConsent);
gtag('consent', 'update', consent);
}
Add this logic to your default consent tag or consent banner initialization.
Method 3: Using GTM’s Consent Mode Template
GTM provides a built-in consent mode template for common scenarios.
Step 1: Add the Consent Mode Template
- Go to Tags → New
- Click “Discover more tag types in the Community Template Gallery”
- Search for “Consent Mode”
- Select a suitable template (e.g., “Consent Mode (Google tags)”)
- Add to workspace
Step 2: Configure Default Consent
Create a tag using the template:
- Name it “Consent Mode - Defaults”
- Set Implementation Type to “Default consent settings”
- Configure each parameter:
- ad_storage: Denied
- ad_user_data: Denied
- ad_personalization: Denied
- analytics_storage: Denied
- Set Wait for Update: 500ms
- Set trigger to “Consent Initialization - All Pages”
- Save
Step 3: Configure Consent Updates
Create another tag for updates:
- Name it “Consent Mode - Update”
- Set Implementation Type to “Update consent settings”
- Map variables for each parameter (from your CMP)
- Set trigger to fire when CMP updates consent
- Save
Configuring Tags for Consent
With Consent Mode implemented, configure how individual tags respond.
Built-In Consent Checks
Google tags (GA4, Google Ads) automatically respond to Consent Mode. No additional configuration needed.
When analytics_storage is denied:
- GA4 sends cookieless pings
- No user identification occurs
- Google models behavior statistically
When ad_storage is denied:
- Google Ads conversion tracking sends limited data
- No cookies are set
- Google models conversions
Non-Google Tags
Third-party tags (Meta Pixel, LinkedIn, etc.) do not automatically respect Consent Mode. Configure them manually.
Option 1: Require Consent via Tag Settings
- Open the tag
- Go to Advanced Settings → Consent Settings
- Select “Require additional consent for tag to fire”
- Add required consent type (e.g., “ad_storage”)
- Save
The tag will only fire when the specified consent is granted.
Option 2: Use Consent-Based Triggers
Create triggers that only fire when consent is granted:
- Create a Custom Event trigger for your CMP’s consent event
- Add conditions: consent_ads equals “granted”
- Use this trigger for advertising tags
Testing Consent Mode Implementation
Thorough testing is critical. Consent Mode errors can break tracking entirely or violate privacy regulations.
Step 1: Test Default State
- Clear cookies and site data
- Open GTM Preview Mode
- Load your website
- Before interacting with the consent banner, check:
- Data Layer shows
consent defaultcommand - All consent parameters are “denied”
- Google tags show “fired” but with consent-adjusted behavior
- Data Layer shows
Step 2: Test Consent Acceptance
- Click “Accept All” on consent banner
- Check:
- Data Layer shows
consent updatecommand - All parameters change to “granted”
- Tags that were waiting now fire fully
- Data Layer shows
Step 3: Test Consent Denial
- Clear cookies and reload
- Click “Reject All” on consent banner
- Check:
- Consent parameters remain “denied”
- Tags fire in limited mode or do not fire
Step 4: Test Partial Consent
- Clear cookies and reload
- Open consent preferences
- Accept Analytics, reject Marketing
- Check:
- analytics_storage: granted
- ad_storage: denied
- GA4 fires normally
- Google Ads fires in limited mode
Step 5: Test Returning Users
- Accept consent
- Close and reopen the browser
- Check that consent state persists
- Tags should fire with previously granted consent
Using Google Tag Assistant
Google Tag Assistant shows Consent Mode state:
- Install Tag Assistant browser extension
- Enable recording
- Navigate your site
- Check the “Consent” tab for each tag
- Verify consent states match expectations
Advanced Configuration
Region-Specific Defaults
Apply different defaults based on user location:
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied',
'region': ['BE', 'BG', 'CZ', 'DK', 'DE', 'EE', 'IE', 'GR', 'ES', 'FR', 'HR', 'IT', 'CY', 'LV', 'LT', 'LU', 'HU', 'MT', 'NL', 'AT', 'PL', 'PT', 'RO', 'SI', 'SK', 'FI', 'SE', 'GB', 'IS', 'LI', 'NO', 'CH']
});
gtag('consent', 'default', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted',
'region': ['US']
});
EEA users start with denied consent. US users start with granted.
URL Passthrough
When consent is denied, enable URL passthrough to maintain attribution:
gtag('set', 'url_passthrough', true);
This passes click identifiers (gclid, dclid) through URL parameters instead of cookies.
Ads Data Redaction
Control what data is sent when ad_storage is denied:
gtag('set', 'ads_data_redaction', true);
When enabled with ad_storage denied, ad click identifiers are redacted from requests.
Common Implementation Mistakes
Mistake 1: Setting Default After Tags Fire
Consent defaults must be set before any Google tags. Use “Consent Initialization” trigger, not “All Pages.”
Wrong trigger order:
- GA4 Configuration fires
- Consent defaults set
Correct trigger order:
- Consent defaults set
- GA4 Configuration fires
Mistake 2: Missing Consent Parameters
Consent Mode v2 requires all four parameters. Missing ad_user_data or ad_personalization means incomplete implementation.
// Incomplete - missing v2 parameters
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied'
});
// Complete - all v2 parameters
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
Mistake 3: Not Updating Consent State
Setting defaults but never calling consent update means consent is always denied, even after user accepts.
Ensure your CMP triggers the update command.
Mistake 4: CMP Loading Too Late
If your consent banner loads after Google tags attempt to fire, consent mode cannot work properly.
Ensure CMP scripts load early, preferably in the <head> before GTM.
Mistake 5: Not Persisting Consent
If consent choices are not saved, users see the banner on every page. Implement proper cookie or localStorage persistence.
Mistake 6: Testing in Wrong Region
Consent Mode behavior may vary by region. Test from EEA IP addresses (or simulate) to verify behavior for regulated users.
Verifying Implementation in Google Ads
After implementation, verify Google Ads receives proper consent signals.
Check Conversion Tracking Status
- In Google Ads, go to Goals → Conversions → Summary
- Click on a conversion action
- Look for “Consent mode” status
- Should show: “Consent mode detected”
Check Tag Diagnostics
- Go to Tools → Data Manager → Diagnostics
- Review any consent-related warnings
- Address issues flagged
Monitor Conversion Modeling
With Consent Mode, Google models conversions from users who denied consent:
- In campaign reports, add “Conversions” column
- Modeled conversions are included in the total
- You cannot see modeled vs observed separately in standard reports
Consent Mode and Server-Side Tracking
Server-side GTM requires additional consideration for Consent Mode.
Passing Consent State Server-Side
The web container must pass consent state to the server container:
// Include consent state in events sent to server
window.dataLayer.push({
'event': 'purchase',
'consent_state': {
'ad_storage': 'granted',
'analytics_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted'
}
});
Server Container Configuration
In your server container:
- Create a variable to extract consent state from incoming requests
- Use the Consent Mode template in server GTM
- Set consent state before firing server-side tags
Monitoring and Maintenance
Consent Mode is not set-and-forget. Monitor ongoing compliance.
Regular Audits
Monthly, verify:
- Consent banner appears correctly
- Consent choices are respected
- Tags fire appropriately per consent state
- No new tags bypass consent
CMP Updates
When your CMP updates, retest:
- Integration still works
- Consent Mode signals still send
- No breaking changes
New Tag Reviews
When adding new tags:
- Determine what consent the tag requires
- Configure consent settings appropriately
- Test in denied state
- Test in granted state
Key Takeaway
Consent Mode v2 is required for compliant advertising measurement in regulated markets. It allows Google tags to adapt behavior based on user consent while maintaining measurement through conversion modeling.
Implementation requires setting default consent states before tags fire, updating consent when users make choices, and configuring tags to respect consent. Use a certified CMP with built-in support for the simplest implementation, or configure manually with gtag.js commands.
Test thoroughly across consent states and regions. Monitor ongoing compliance as you add new tags and as regulations evolve.
Without Consent Mode v2, your Google Ads campaigns in the EEA cannot build audiences or measure conversions effectively. With it, you balance privacy compliance and advertising performance.
Related Posts
Why Consent Mode Is Silently Killing Your Google Ads Conversions
13 min read
Consent Mode Data Loss: How to Recover Tracking with Third-Party Tools
15 min read
GA4 and Consent Mode v2 - How to Keep Tracking Without Killing Data Quality
9 min read
Need Help With Your Google Ads?
I help e-commerce brands scale profitably with data-driven PPC strategies.
Get In Touch