Trackum

Setting up Google Consent Mode v2 correctly: no warning in Tag Assistant

The most common warning in Tag Assistant says a tag read consent before a default was set. How to avoid it, and what else matters.

Features · · 3 min read · Written with AI

Setting up Google Consent Mode v2 correctly: no warning in Tag Assistant
📷 Sasun Bughdaryan · Unsplash

Consent Mode is the link between your cookie banner and the Google tags. The banner learns what the visitor allows, and Consent Mode passes it on to Google Analytics and Google Ads. Version 2 added two new types, ad_user_data and ad_personalization. Without them, Google Ads makes only limited use of data from the EU.

The order is what matters

The default comes first, with everything set to "denied". Only then may tags run or read consent. In Tag Manager, this is done with a template that calls setDefaultConsentState on the "Consent Initialization" trigger.

There is a trap we see often: Google only processes the default once the template has finished. If the same template, or another tag on "Consent Initialization", reads consent, for example to register a listener, that counts as a read before the default. Tag Assistant then shows a red warning. The fix: the default template reads nothing, and everything else runs on "Initialization".

→ Cookie banner with Consent Mode v2: compliant, with no monthly licence

When the visitor makes a choice in the banner, consent should be set with updateConsentState from a template. A gtag command from a Custom HTML tag is buffered and is not reliably processed before the next trigger. This is how Google describes it for Tag Manager.

Withdrawal: immediately, not on the next page load

A Google Analytics tag that has already loaded keeps sending after a withdrawal until the page is reloaded. On withdrawal, Trackum therefore also sets the opt-out signal for the measurement ID, and GA4 stops immediately. If the visitor consents again later, it is released again.

→ Marketing dashboard with GA4 and Google Ads: every number on one page

How we test every setup

  • Before a choice: no request to Google Analytics, Google Ads or Meta
  • After "Accept all": every consent type granted, exactly one page view
  • After "Reject": nothing
  • Tag Assistant: no consent warning
  • Reload: no banner, the choice is applied

Frequently asked questions

What is the difference between basic and advanced mode?

In basic mode, Google tags only load after consent. In advanced mode, they load immediately and send cookieless pings without consent. Trackum sets up basic mode by default, because then nothing goes to Google before consent.

How do I know the default is set too late?

Tag Assistant shows a warning that a tag read the consent state before a default was set. In the browser, google_tag_data.ics.wasSetLate then has the value true.

Do I need consent settings on every tag?

Yes. Each tag gets the consent types it needs in its consent settings. Analytics tags need analytics_storage, advertising tags need ad_storage, and conversions also need ad_user_data.

Help