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.
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
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.