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

Lesson 8 of 10

Consent Mode V2

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

Modern privacy law (GDPR, and now Consent Mode v2 for Google's ad and analytics tags) expects measurement to wait until a visitor agrees. GTM models this in two layers: a default consent state the page sets before anything fires, and a per-tag Consent Settings gate that holds an individual tag until the signal it needs is granted.

Consent Mode v2 starts every signal denied. The four that matter are ad_storage, analytics_storage, ad_user_data and ad_personalization. A consent banner pushes a consent: update when the visitor chooses, flipping the relevant signals to granted.

Here you'll gate a tag on analytics_storage. Toggle consent below and a tag wired this way will hold while denied and fire once granted, which is exactly what you want to see in Tag Assistant.

Goal

Gate a tag on analytics_storage so it holds while consent is denied and fires once granted.

Build it in GTM

  1. Trigger: Custom Event - Promo View

    1. Go to Triggers in the left sidebar and click New.
    2. Choose Custom Event and set the event name to promo_view (the event the page below pushes).
    3. Name it Custom Event - Promo View and Save.
  2. Tag: a GA4 Event tag (or Custom HTML - Test)

    1. Go to Tags → New. Pick GA4 Event (event name promo_view), or Custom HTML with <script></script> if you just want the stand-in.
    2. Under Triggering, add Custom Event - Promo View.
  3. Gate the tag on analytics_storage

    1. Still in the tag, open Advanced Settings → Consent Settings.
    2. Choose Require additional consent for tag to fire and add analytics_storage.
    3. Name the tag GA4 - Promo View and Save.

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 consent denied, Tag Assistant lists the tag under Tags Not Fired with a consent reason. Grant consent, fire the event again, and it moves to Tags Fired.

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

0 of 10 lessons complete