Consenti

Google Consent Mode for GTM

This is the GTM-console side of Consent Mode v2 — what to click inside Google Tag Manager itself, as opposed to the JavaScript config on your site. If you've already wired up a cookie banner and just need GTM to respect it, this is the checklist.

1. Turn on container-level consent settings

In GTM: Admin → Container Settings → Additional Settings → Consent Overview. Turning this on surfaces a consent status for every tag in the container and unlocks the built-in Consent Initialization — All Pages trigger.

2. Set the default consent state before anything fires

GTM needs to know the default (denied) state before any other tag evaluates. Two ways to do this:

  • Consent Initialization trigger — a special trigger type that always fires before any regular tag, used with a small custom HTML tag that calls gtag('consent', 'default', {...}).
  • Default consent set outside GTM — if your cookie banner already calls gtag('consent', 'default', ...) before the GTM snippet loads (the pattern Consenti and similar libraries use), you can skip step 2 inside GTM entirely — the default is already set by the time GTM tags evaluate.
Consent Initialization tag (if not set upstream)
javascript
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

gtag('consent', 'default', {
  ad_storage: 'denied',
  ad_user_data: 'denied',
  ad_personalization: 'denied',
  analytics_storage: 'denied',
  functionality_storage: 'granted',
  security_storage: 'granted',
});
⚠️Do this only once. If your cookie banner already sets the default before GTM loads (check the dataLayer in DevTools for a consent_default entry), adding a second Consent Initialization tag inside GTM will conflict with it and can cause tags to briefly read the wrong state.

3. Add consent checks to each tag

Open a tag (e.g. GA4 Configuration, Google Ads Conversion) → scroll to Consent Settings → check Require additional consent for tag to fire → select the relevant signal (analytics_storage for GA4, ad_storage for Ads tags). GTM will now hold that tag until the signal is granted, without you writing a custom trigger condition.

4. Confirm the update call reaches GTM

When a visitor changes their preference, your banner needs to call gtag('consent', 'update', {...}). GTM tags configured with consent checks re-evaluate automatically — no extra trigger needed, no page reload.

5. Debug in Preview mode

  1. Open GTM Preview and load your site.
  2. Check the summary panel — each tag shows whether it fired or was blocked by consent.
  3. Click a blocked tag to see exactly which signal it was waiting on.
  4. Accept the relevant category in your banner and confirm the tag fires without a reload.

If you're using a library that already owns the default/update calls — Consenti's utils.gtm config does this on the JS side — the GTM-console work is mostly steps 3 and 5: adding consent checks per tag and verifying them in Preview. See the GTM & Google Consent Mode v2 guide for the config API, or Google Consent Mode v2 Explained for the concepts behind basic vs. advanced mode.

Frequently asked questions