Lesson 9 of 10
Consent Mode Advanced
① Connect your GTM container
Paste your container ID to load it into this page. It only ever runs here.
Advanced: use a specific environment
Basic consent gating treats every visitor the same. Real deployments don't: a visitor in the EEA must start denied by law, while elsewhere you may default to granted. Consent Mode lets you set those defaults per region, then soften what a denied state still loses.
Three controls do the heavy lifting. A region array on a default-consent command targets specific countries. url_passthrough keeps click IDs (like gclid) flowing through URLs even while cookies are denied, so conversions can still be attributed once consent is granted. ads_data_redaction strips ad identifiers from the pings a denied visitor still sends.
Switch the simulated region to EEA below and grant consent to see the difference a regional default makes. This one lives in configuration, so there's nothing to export, just settings on your Consent Mode setup.
Goal
Set region-specific consent defaults and keep attribution alive with url_passthrough.
Build it in GTM
Default to denied for the EEA, granted elsewhere
- In your CMP template (or a Custom HTML default-consent tag on the Consent Initialization trigger), set a default with all signals
deniedand a region array of EEA country codes. - Add a second default with the signals you allow set to
grantedand no region, so it covers everywhere else.
- In your CMP template (or a Custom HTML default-consent tag on the Consent Initialization trigger), set a default with all signals
Turn on
url_passthroughEnable URL passthrough sogclidand other click IDs survive in the URL while storage is denied. Without it, a denied visitor who later converts can't be attributed.Turn on
ads_data_redactionEnable ads data redaction so ad-click identifiers are removed from the cookieless pings a denied visitor still sends, the privacy-safe default while you wait for consent.
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