1. What Changed in Consent Mode v2?
Google Consent Mode v1 only controlled whether cookies could be stored (ad_storage and analytics_storage). Under the European Digital Markets Act (DMA), Google now acts as a designated "gatekeeper" and must legally ensure user consent before processing personal data for advertising.
Consent Mode v2 introduces two additional mandatory consent signals:
- ad_user_data: Controls whether user data (e.g., hashed email addresses from enhanced conversions) can be sent to Google for advertising purposes.
- ad_personalization: Controls whether data can be used for remarketing, personalized audience lists, and ad targeting.
2. Basic vs. Advanced Consent Mode
Basic Consent Mode
Tags are completely blocked from executing until the user grants consent. No pings or cookieless data are sent to Google.
Advanced Consent Mode
Tags load in a restricted, cookieless state before consent. Google uses machine learning modeling to recover up to 70% of lost conversion data.
3. Exact Implementation Code
Paste this script in your HTML <head> before your Google Tag Manager script tag:
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Set default consent state for all users
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'wait_for_update': 500
});
gtag('set', 'ads_data_redaction', true);
</script>