Why is my consent banner completely blocking Google Tag Manager?

Kilian Müller
Kilian MüllerOwner of 1hold.de · Google PartnerUpdated
Consent ModeGoogle Certified Specialist

A consent banner blocks Google Tag Manager completely when the banner’s script blocker treats the Tag Manager container like any other tracking script, or when the setup is deliberately built as basic consent mode. In both cases no Google tag loads before the visitor clicks, and if they decline, nothing loads at all. Whether that is a bug or intended depends on which of the two consent mode variants you want to run.

Google distinguishes two ways of implementing consent mode. In basic consent mode, Google tags are blocked until the user interacts with the banner, and no data reaches Google before that. In advanced consent mode, the tags load immediately with default consent states set to denied and only send cookieless pings until consent is granted. Which variant is permissible for your website is a legal question that you should clarify with your data protection officer.

Why does the banner block the whole container?

  • Automatic script blocking. Many consent management platforms (CMPs) scan the page and block every script that looks like tracking, including googletagmanager.com/gtm.js. Tag Manager then never starts, and all tags inside it stay silent, including those that do not need consent.
  • The container snippet was wrapped. Sometimes the Tag Manager snippet is rewritten so that it only runs after consent, for example with a changed script type or a category attribute of the CMP. That turns your setup into basic consent mode, whether you planned it or not.
  • Wrong loading order. If the banner script loads after the container and sets its defaults late, tags may already have fired without consent information, or the CMP blocks everything to be on the safe side.
  • Missing consent update. The banner shows, the visitor accepts, but the CMP never sends a consent update to Google. The default states stay at denied, and tags that require consent never fire.

How do I fix it?

  1. Decide on basic or advanced. If basic consent mode is intended, the behavior is correct and you only need to make sure everything loads after consent. If you want advanced consent mode, Tag Manager must be allowed to load before the click.
  2. Exclude Tag Manager from the script blocker. In the CMP settings, mark the Tag Manager container as a script that may load without consent. The consent decision then happens inside the container, per tag.
  3. Load the banner through Tag Manager. Google recommends loading your banner via the container if you use Tag Manager. Many CMPs offer a consent mode template in the Community Template Gallery. Fire it with the Consent Initialization – All Pages trigger, which always fires before all other tags.
  4. Set defaults and updates. The template or banner sets the defaults for ad_storage, ad_user_data, ad_personalization and analytics_storage and sends an update after every decision. If the banner loads asynchronously, the wait_for_update parameter gives it time before data is sent.
  5. Configure non-Google tags. Google tags adjust their behavior through built-in consent checks. For other tags, such as third-party pixels, set Advanced Settings → Consent Settings → Require additional consent for tag to fire in each tag.

How do I check that it works?

  1. Start the Tag Manager preview and open the Consent tab before clicking the banner. You should see the default states, all denied.
  2. Accept the banner and check the same tab again. The update must show the granted states, and the tags that need consent should now fire.
  3. Repeat the test with a decline. Tags that require additional consent must not fire.
  4. In the browser’s developer tools under Network, check that gtm.js loads before the click if you use advanced consent mode.

Decide first whether you run basic or advanced consent mode. For advanced, let the container load, control the banner through a template with the Consent Initialization trigger, and test default and update states in the preview.

Sources

Not sure whether your banner and Tag Manager work together correctly? We check the loading order, consent states and tag settings and show you where data is lost. Book a free intro call or read more about our tracking services.

Need personal advice?

Our Google-certified experts are happy to help – free and without obligation.

Book a meeting