- Loading OneTrust or Cookiebot asynchronously inside GTM causes GA4 and Google Ads to initialize before consent defaults exist, producing broken gcd=13l3l3l3l1 hits.
- Always declare gtag('consent','default',...) synchronously in
<head>above the GTM snippet with EEA/UK defaults set to denied and wait_for_update: 500. - In Server-Side GTM, inspect incoming gcs/gcd consent flags before dispatching Meta CAPI, LinkedIn CAPI, or CRM webhooks so non-Google tags stay strictly gated.
- Verify any Chrome DevTools /g/collect request instantly in our free Consent Mode v2 Decoder (/tools/consent-mode-decoder/).
Loading OneTrust or Cookiebot asynchronously inside Google Tag Manager causes a race condition where GA4 and Google Ads tags initialize before consent defaults exist (visible as gcd=13l3l3l3l1). Always declare gtag('consent', 'default', ...) synchronously in <head> above the GTM snippet, set EEA/UK defaults to denied, and let your CMP fire strictly gtag('consent', 'update', ...) upon user choice.
Consent Mode v2 Script Load Order & Expected gcd States
| Load Sequence Step | What Executes | Expected EEA gcd State |
|---|---|---|
1. Inline <head> Script (First) | gtag('consent','default',{...denied}) | p (denied default declared) |
| 2. CMP Script (OneTrust / Cookiebot) | Renders banner & listens for choice | Remains p until user clicks |
| 3. First-Party sGTM Container | Initializes GA4/Ads respecting default | Sends cookieless modeling ping only |
| 4. User Clicks Accept / Decline | CMP fires gtag('consent','update',...) | r (granted) or q (declined) |
Synchronous Consent Default Order (Above GTM)
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
// 1. Strict EEA/UK default BEFORE GTM loads
gtag("consent", "default", {
ad_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied",
analytics_storage: "denied",
wait_for_update: 500,
region: ["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IS","IE","IT","LV","LI","LT","LU","MT","NL","NO","PL","PT","RO","SK","SI","ES","SE","GB","CH"]
});
// 2. Non-EEA fallback default (aligned to counsel policy)
gtag("consent", "default", {
ad_storage: "granted",
ad_user_data: "granted",
ad_personalization: "granted",
analytics_storage: "granted"
});
</script>
<!-- 3. Now load OneTrust/Cookiebot + first-party sGTM script -->
Server-Side GTM Enforcement & Verification Tools
In your sGTM container, inspect the incoming gcs/gcd parameters before dispatching Meta CAPI, LinkedIn CAPI, or custom CRM webhooks, blocking third-party ad tags whenever ad_user_data is denied while letting Google receive anonymous cookieless modeling pings. Verify any DevTools hit immediately with our free Consent Mode v2 Decoder, check your raw HTML defaults in our Live Funnel Leak Inspector, or read CMP vendor docs: Cookiebot Help Center, OneTrust Support, and Stape sGTM Docs.