Skip to content

Complianz with Google Tag Manager: making tags wait for consent (Consent Mode v2)

Connect Complianz to Google Tag Manager so tags only fire after consent: the Wizard setting, the Complianz GTM template, consent events and how to test it.

Lukas Kontur · · 5 min read

When Google Tag Manager (GTM) loads your tracking, Complianz cannot block the individual tags inside the container the way it blocks scripts on the page. Instead, Complianz tells GTM what the visitor chose, and every tag in GTM has to act on that. If one tag ignores it, that tag fires before consent while the banner looks fine. This guide shows the setup Complianz documents and how to check that it works.

The symptoms

  • A scan reports trackers before consent or analytics cookies before consent although the Complianz banner shows and its dashboard looks complete.
  • In GTM preview mode, tags fire on Container Loaded or Page View before anyone clicks the banner.
  • Google tags report consent signals that do not match the banner choice (a Consent Mode mismatch).

Step 1: tell Complianz that GTM fires your tags

In WordPress, open Complianz, Wizard, Consent, Statistics and choose "Yes, and Google Tag Manager fires this script". On the Statistics configuration page, enter your GTM container ID (Complianz: Consent Mode v2 guide).

If this option is missing, another plugin probably already loads Google. Complianz names Site Kit, MonsterInsights, Google Analytics for WooCommerce and GTM4WP as integrations that can hide it (same guide). Load GTM from one place only; a second copy of the container is a common source of tags that fire before consent. On a Site Kit site, see Complianz and Site Kit: Consent Mode v2.

Complianz's Consent Mode v2 guide, whose steps require Complianz Premium, uses a GTM template:

  1. When the Wizard asks "Will you be using our Tag Manager template?", answer Yes.
  2. In GTM, open Templates, search the Community Template Gallery for Complianz and click Add to workspace.
  3. Create a tag from the template and fire it on Consent Initialization - All Pages, so the default consent state is set before any other tag runs.
  4. Keep the Default Consent State that Complianz pre-configures. Its guide says you do not need to change it. Before consent, only functionality_storage and security_storage are granted; after Accept All, the others change to granted.

The template is what sends the Consent Mode signals (ad_storage, analytics_storage, ad_user_data, ad_personalization) to Google tags. For what these mean, see Google Consent Mode v2 setup.

Step 3: make every tag wait for its category

Consent Mode only changes how Google tags behave. Tags from other vendors, such as the Meta Pixel, Hotjar, TikTok or LinkedIn, ignore it and fire as soon as their trigger fires. They must wait for a Complianz consent event.

Complianz pushes one event per category to the data layer (Complianz: Tag Manager guide):

CategoryEvent
Functionalcmplz_event_functional
Preferencescmplz_event_preferences
Statisticscmplz_event_statistics
Marketingcmplz_event_marketing

For each event, create a trigger of type Custom Event with that event name (or import the triggers from the container Complianz provides). Then:

  • Analytics tags (for example a GA4 Google tag) fire on the statistics trigger.
  • Advertising and social pixels fire on the marketing trigger.
  • Remove All Pages, Page View and Container Loaded triggers from these tags. A tag with two triggers fires on whichever comes first.

The Tag Manager guide warns that under GDPR, if analytics is not configured privacy-friendly, consent is required and you cannot use All Pages or cmplz_event_functional for it.

Step 4: choose basic or advanced mode deliberately

In the premium Statistics configuration, Complianz asks whether to block all Google tags before consent. Its guide recommends No, which is Google's advanced mode: Google tags load before consent with "denied" signals and send cookieless pings. Yes is the basic mode: no Google tag loads until consent. A scan shows the difference: in advanced mode you will see requests to Google before consent, normally without the _ga cookie. Pick the mode that matches what your banner and privacy policy tell visitors.

How to verify the setup

  1. In GTM, click Preview and open your site. Before you click the banner, only the Complianz template and essential tags may have fired. No GA4, Ads or marketing tag in the Tags Fired list.
  2. Click Deny or Reject: still no analytics or marketing tags.
  3. In a fresh preview session, accept only Statistics: GA4 fires, marketing tags do not.
  4. Accept everything: marketing tags fire too.
  5. Publish the container, clear every cache, and repeat the check in a private window without preview, using the manual consent test.

For mistakes that apply to any consent tool in GTM, see GTM Consent Mode v2 mistakes. If scripts outside GTM still leak, see Complianz not blocking GA4 or Meta Pixel.

Sample scan

78 / 100

High risk · Trackers: 23 · Pre-consent tracking: yes

See sample report →

Check your site in 1 minute

Our free scan loads your site in a clean browser and shows which tags ran before the Complianz banner was answered and after Reject. No signup needed. Run a free scan.

Get alerted when it breaks

One new tag with the wrong trigger is enough to reopen the leak. With monitoring, we re-scan your site on a schedule and email you when a tracker starts running before consent. Create an account and add your site.

Last updated: