Google Consent Mode v2
Built-inEasyConsent automatically integrates with Google Consent Mode v2 — no configuration needed.
Required since March 2024: Google requires all EU websites using Google Ads or GA4 to implement Consent Mode v2. Without it, you may lose 60–90% of conversion measurement data.
How it works
When EasyConsent loads on your page, it automatically detects if gtag() is present and initializes Google Consent Mode with all signals set to denied by default. When the visitor makes a consent choice, EasyConsent updates the signals immediately.
Flow
1. EasyConsent loads → sets all signals to "denied"
2. Visitor sees cookie banner
3. Visitor accepts / declines / customizes
4. EasyConsent calls gtag("consent", "update", {...})
5. GTM / GA4 / Google Ads receive updated signals
Signal mapping
EasyConsent maps your cookie categories to Google's consent signals as follows:
| EasyConsent Category | Google Signal | Default |
|---|---|---|
| necessary | functionality_storage, security_storage | granted |
| functional | functionality_storage | denied |
| analytics | analytics_storage | denied |
| marketing | ad_storage, ad_user_data, ad_personalization | denied |
GTM setup
The only requirement is load order. EasyConsent must appear before GTM in your HTML:
HTML — correct order
<head>
<!-- ✅ Step 1: EasyConsent first -->
<script
src="https://widget.easyconsent.eu/widget/{UUID}.js"
async
></script>
<!-- ✅ Step 2: GTM after -->
<script>(function(w,d,s,l,i){...GTM snippet...})</script>
</head>
❌ Do not load GTM before EasyConsent. If GTM fires first, the default consent state won't be set and Google will not respect the denied state.
Verification
Open your browser DevTools console and check for these messages on page load:
EasyConsent: Google Consent Mode v2 initialized (default: denied) EasyConsent: Widget loaded for domain example.com
After a visitor accepts cookies:
EasyConsent: Google Consent Mode updated
{
analytics_storage: "granted",
ad_storage: "granted",
ad_user_data: "granted",
ad_personalization: "granted",
functionality_storage: "granted"
}