The short answer
Consent Mode in Google Tag Manager needs one thing above all: a default, with every signal denied, set before Tag Manager's own events run. Put it in an inline script above the container snippet, or in a tag on the Consent Initialization trigger, and let your banner send an update when the visitor chooses. In our test, a default set just below the snippet, set late by a slow banner, or pushed as a plain dataLayer object let Google's tags fire with consent not set, and the ad cookie _gcl_au was set before anyone clicked.
What Consent Mode does in Tag Manager
Consent Mode is Google's way of telling its tags what a visitor agreed to. There are four signals that matter for Google Analytics and Google Ads: ad_storage, analytics_storage, ad_user_data and ad_personalization. Each is either granted or denied.
Two commands set them. A default says what's true before the visitor has chosen. An update comes from your banner once they do. Google's own tags (the Google tag, GA4 events, Google Ads) read the signals and change what they send. With everything denied they still send pings, but cookieless ones. Our Consent Mode v2 explainer covers that in detail.
Google's developer guide is plain about it: "By default, no consent mode values are set." If the default arrives after a tag has fired, that tag fired with no consent state at all.
Where the default has to sit
Before any tag runs. Google's guide says to call the default "before any commands" that send measurement data, and warns: "If your consent code is called out of order, consent defaults won't work."
In Tag Manager that leaves two places:
- An inline script above the container snippet, in
<head>. It definesdataLayer, definesgtag(), and callsgtag('consent', 'default', {...})with all four signals denied. - A tag on the Consent Initialization trigger. Google's help page says this trigger "will always fire before all other tags, including any Initialization triggers", and names it for tags that set consent, such as a consent tool's own tag.
Either works when it's done right. We tested the inline script; the Consent Initialization route is the one Google documents for Tag Manager. The inline script has one advantage: it doesn't depend on Tag Manager loading at all.
What we found when we moved it
On 28 October we loaded Google's live gtm.js for a published test container on a test page. The container held a Google tag on Initialization, GA4 and a Google Ads conversion on purchase, and Ads remarketing with the Conversion Linker on All Pages.
Every measurement request to Google was recorded, then stopped, so no data reached Google. The visitor answered after 3 seconds, then the page pushed a purchase. We ran all 11 setups twice.
| Where the default was | Before the visitor chose | Cookies before a choice |
|---|---|---|
| Inline, above the snippet | 5 cookieless pings (gcs=G100) | none |
| Inline, just below the snippet | 4 requests with no consent state (2 of them Google tag page views), then 3 cookieless pings | _gcl_au |
| Set by a banner script 1.5 s after load | 11 requests with no consent state, including GA4's page view and remarketing | _ga, _gcl_au |
| No default, banner sends only an update | the same 11 | _ga, _gcl_au |
dataLayer.push({consent: 'default', ...}) | the same 11 | _ga, _gcl_au |
dataLayer.push(['consent', 'default', {...}]) | the same 11 | _ga, _gcl_au |
With the default above the snippet, a Reject behaved as it should: the purchase still went to GA4 and Google Ads, cookieless, and no cookie was set. An Accept set _ga and _gcl_au, and the conversion went out with gcs=G111 (ads and analytics granted).
You can read the state in each request's gcd value. In the broken rows the Google requests showed l for every signal, which Simo Ahava's decoding table defines as "the signal has not been set with Consent Mode".
Where no default was ever read (no default, or a dataLayer.push), a Reject then showed m: denied by an update, with no default. Where the default arrived late, it showed q: denied by both.
Why "just below the snippet" fails
It looks harmless. The snippet loads gtm.js asynchronously, so a default on the next line still lands in dataLayer before the container runs.
It lands in the wrong order, though. The snippet pushes its gtm.js event onto dataLayer before your default gets there. In our test the Google tag on Initialization sent two page views to Google with consent not set, and the Ads cookie was written, before the default was read.
GA4's own page view went out correctly a moment later. Both runs matched.
The two dataLayer.push rows are a different mistake. In our test, Tag Manager only read the default when it came from gtag(), which pushes its arguments object. A plain object or array looks similar in the code and did nothing.
Returning visitors and wait_for_update
When a visitor has already accepted, your banner reads their saved choice and sends an update. That takes a moment, and Google's tags may fire first, as cookieless pings.
wait_for_update fixes that. It's a number of milliseconds added to the default, telling Google's tags how long to wait for an update. In our test, with wait_for_update: 2000 and the saved Accept arriving after 1 second, nothing was sent until the update, then everything went out granted. Without it, 5 cookieless pings went first. Google's own example uses 500.
The rest of the container
Google's tags have built-in consent checks: they read the signals by themselves. Leave those alone. Every other vendor's tag needs additional consent checks, set under the tag's Advanced Settings › Consent Settings, so it waits for the right signal. A Meta Pixel on "Not set" fires for everyone. Our guide to Tag Manager's consent settings walks through each tag type.
Turn on the consent overview too (Admin › Container Settings › "Enable consent overview"). It shows every tag's consent setting on one screen.
Check your own setup
- View your page source. Is the default above the Tag Manager snippet, or in a Consent Initialization tag?
- Is it written as
gtag('consent', 'default', ...), not adataLayer.pushof an object? - Open a private window, then developer tools › Network, and filter for
collect. Reload without clicking the banner. - Every request should carry
gcs=G100, and itsgcdshould showpfor all four signals (13p3p3p3p…in our test, meaning denied by default), notl(not set). Look at Application › Cookies: there should be no_gaor_gcl_auyet. - Accept, and check for
gcs=G111.
How to check Consent Mode v2 is working explains the other values you'll meet.
Where TagSentry fits
TagSentry is one line of code you put above Google Tag Manager. Before any tag runs, it sets every Consent Mode signal to denied, so the default comes first. Google's tags then run cookieless until a visitor agrees, and Google can still model conversions. If our CDN can't be reached, Google's consent signals stay denied.
The Install screen reads your homepage and names any Google tag that loads before our line, such as Google Analytics.
If you connect Tag Manager, we can update the consent settings on your existing tags with your OK, so each one waits for the right yes. Every change is a new version in your own Tag Manager, naming the one it replaced. How consent works shows the rest.