Don't have one? Create one ↗
← All courses

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

  1. Default to denied for the EEA, granted elsewhere

    1. In your CMP template (or a Custom HTML default-consent tag on the Consent Initialization trigger), set a default with all signals denied and a region array of EEA country codes.
    2. Add a second default with the signals you allow set to granted and no region, so it covers everywhere else.
  2. Turn on url_passthrough

    Enable URL passthrough so gclid and other click IDs survive in the URL while storage is denied. Without it, a denied visitor who later converts can't be attributed.
  3. Turn on ads_data_redaction

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

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

With EEA defaults set to denied, your gated tags hold until the visitor grants consent. Outside the EEA they fire on load. In Tag Assistant's Consent tab you can read the on-page default and update states.