Lessons in this module
Lesson 14 of 16
Regions And Wait_For_Update
① Connect your GTM container
Paste your container ID to load it into this page. It only ever runs here.
Advanced: use a specific environment
One default does not fit the whole planet. GDPR wants everything denied in the EEA, California is an ad-signals opt-out story, and much of the world needs no gate at all. Consent Mode handles this with region-scoped defaults: you call gtag('consent', 'default', ...) several times, each with a region array of country (or country-subdivision, like US-CA) codes, plus one region-less call as the everywhere-else fallback. The most specific match wins.
The second tool is wait_for_update: 500: it asks tags to hold their first hits up to 500 ms so a CMP that already knows the visitor's choice can deliver the update before anything is sent. Switch the visitor region below and watch the same page open three different ways.
Goal
Write region-scoped consent defaults with wait_for_update, and see how EEA, US-CA and everywhere-else visitors start differently.
Build it in GTM
Extend your consent-default tag with regions
Open your
Custom HTML - Consent Defaulttag (from the defaults lesson, still on Consent Initialization) and make it three calls, strictest first:<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} // EEA: everything denied gtag('consent', 'default', { ad_storage: 'denied', analytics_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied', region: ['ES','DE','FR','IT','NL','BE','SE','PL','AT','IE'], wait_for_update: 500 }); // California: ad signals denied, analytics allowed gtag('consent', 'default', { ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied', analytics_storage: 'granted', region: ['US-CA'], wait_for_update: 500 }); // Everywhere else gtag('consent', 'default', { ad_storage: 'granted', analytics_storage: 'granted', ad_user_data: 'granted', ad_personalization: 'granted' }); </script>Understand the matching rules
A more specific region beats a less specific one:US-CAbeats aUSrule, and any region rule beats the region-less fallback. Order in the code doesn't decide; specificity does. Google reads the visitor's region from the request, you never detect it yourself.Give the CMP its window
Keepwait_for_update: 500on the denied defaults. Returning visitors whose choice is already stored get it re-applied inside that window, so their very first hits carry the right consent instead of being modeled unnecessarily.
Debug in Tag Assistant
Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.
- In your GTM, click Preview.
- Paste the live URL above and click Connect.
- Interact with the live page and watch your tag fire in Tag Assistant.
What you should expect to see
Verify your container
Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.
Drop your container .json here
or browse · checked in your browser, nothing is uploaded