All posts
Consent ModeGTMGA4Privacy

Google Consent Mode v2: The Complete Implementation Guide

Layer AnalyticsJune 21, 2026Updated July 2, 202616 min read

Listen to this article

0:00 / 21:23

Google Consent Mode v2 is a JavaScript API that tells Google's tags whether a user has granted or denied consent for advertising and analytics, so the tags can adjust their behavior — from fully firing to sending anonymous, cookieless "consent signals" — instead of being blocked outright. If you run Google Ads, Google Analytics 4, or remarketing tags and you have users in the European Economic Area (EEA), the UK, or Switzerland, Consent Mode v2 is effectively mandatory: without it, Google stops populating remarketing audiences and degrades conversion measurement for EEA traffic. This guide walks through the model, both implementation modes, the exact GTM and gtag code, server-side tagging, and how to validate it — with the 2026 details that most tutorials get wrong.

Consent Mode is not a consent banner. It does not collect consent, store a user's choice, or draw any UI. It is a signalling layer that sits between your Consent Management Platform (CMP) — the banner that captures the user's choice — and Google's tags. The CMP decides what the user wants; Consent Mode translates that decision into a set of named signals that gtag.js, GA4, and Google Ads tags read before they do anything.

Consent Mode governs seven consent types. The two that define v2 — and the reason the whole ecosystem had to re-implement in 2024 — are the last two:

Consent signalGovernsIntroduced
ad_storageCookies/identifiers for advertisingv1
analytics_storageCookies/identifiers for analytics (GA4)v1
functionality_storageStorage that enables site functionalityv1
personalization_storageStorage for on-site personalizationv1
security_storageStorage for security (fraud, auth)v1
ad_user_dataWhether user data may be sent to Google for adsv2
ad_personalizationWhether data may be used for remarketing/personalized adsv2

ad_user_data and ad_personalization are the additions that make it "v2." They exist to give an explicit, auditable answer to two GDPR-relevant questions that ad_storage alone could not: may we transmit this person's data to Google at all, and may we use it to personalize advertising. Since March 2024, Google requires both signals for EEA traffic to keep remarketing and personalized-advertising features working; when they are absent or denied, those features are suppressed for that user.

Each signal can be 'granted' or 'denied'. Consent Mode has two operating modes that determine what happens when a signal is 'denied'.

Basic vs Advanced mode: the decision that shapes everything

This is the single most important architectural choice, and it is frequently glossed over.

Basic mode blocks Google tags entirely until the user interacts with the banner. Tags do not load, no network request is sent, and no signals — not even anonymous ones — reach Google before consent. If the user denies, nothing fires at all. Because Google receives zero hits from non-consenting users, it has very little data to model with, and conversion modeling is weak or unavailable.

Advanced mode loads Google tags immediately with all consent defaulted to 'denied'. When consent is denied, the tags still send cookieless pings — no cookies, no identifiers, no persistent state — carrying minimal, non-identifying information (timestamp, coarse signals, whether consent was granted). Google uses these anonymous pings, combined with observed conversions from consenting users, to model the behavior of non-consenting users. Advanced mode is what most guides mean when they say "Consent Mode," and it is what makes conversion modeling meaningful.

Basic modeAdvanced mode
Tags before consentNot loadedLoaded, all signals denied
Pings when deniedNoneAnonymous cookieless pings
Conversion modelingMinimalRobust (needs threshold traffic)
Data sent for denied usersNothingNon-identifying signals only
Privacy footprintSmallestSmall, but non-zero
Setup complexityLowerHigher (default → update sequencing)

The trade-off is real: Advanced mode recovers more measurement but sends anonymous pings even from users who declined, so your Data Protection Officer or legal counsel — not your analytics team — should sign off on which mode you run. There is no universally "correct" choice; it depends on your risk posture and jurisdiction.

The default → update sequence (the part everyone breaks)

Consent Mode works on a strict order of operations. Get the order wrong and you either leak data before consent or lose the tags' ability to "replay" once consent arrives.

  1. Set defaults first. Before any Google tag or config command runs, call gtag('consent', 'default', {...}) with every signal set to its pre-consent state. For EEA users this is almost always 'denied' across the board.
  2. The CMP shows the banner and the user chooses.
  3. Update on choice. The CMP (or your code) calls gtag('consent', 'update', {...}) with the granted signals flipped to 'granted'.
  4. Tags react. Tags that were queued behind wait_for_update now fire with the correct storage behavior, and tags already loaded upgrade from cookieless to full.

Two parameters make this reliable:

  • wait_for_update (milliseconds) tells Google's tags to pause briefly on page load so an asynchronous CMP has time to call update before the tag decides how to behave. Without it, a slow banner means the tag fires in its default (denied) state and never upgrades on that pageview. A value in the 500–2000 ms range is typical; tune it to your CMP's real load time.
  • url_passthrough appends ad-click identifiers (gclid, dclid, etc.) to internal link URLs when cookies aren't available, so click attribution survives a denied ad_storage. Pair it with ads_data_redaction: true, which strips ad identifiers from the network requests Google's ads tags send while ad_storage is denied.

Here is the canonical gtag.js default block. It must appear in the <head> before the GA4/Ads config lines and before your CMP's own gtag calls:

<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){ dataLayer.push(arguments); }

  // 1. Defaults — everything denied until the user chooses.
  gtag('consent', 'default', {
    'ad_storage': 'denied',
    'ad_user_data': 'denied',
    'ad_personalization': 'denied',
    'analytics_storage': 'denied',
    'functionality_storage': 'denied',
    'personalization_storage': 'denied',
    'security_storage': 'granted',   // security storage is generally kept on
    'wait_for_update': 500
  });

  gtag('set', 'url_passthrough', true);
  gtag('set', 'ads_data_redaction', true);
</script>

And the update call your CMP fires after an "Accept all" click:

gtag('consent', 'update', {
  'ad_storage': 'granted',
  'ad_user_data': 'granted',
  'ad_personalization': 'granted',
  'analytics_storage': 'granted'
});

A partial-consent choice simply flips a subset — e.g. a user who accepts analytics but declines ads leaves the three ad-related signals denied and sets analytics_storage: 'granted'.

The Consent Mode v2 signal flow

Page load

gtag consent default = denied

Tags load (Advanced)

cookieless pings only

CMP banner

user makes a choice

gtag consent update

granted signals flip on

Tags upgrade

full measurement resumes

In Advanced mode, tags load defaulted-denied, send anonymous pings, then upgrade on the update call.

For most sites, GTM is the cleanest home for Consent Mode because GTM has native consent-checking built into every tag. The setup has three parts.

1. The default consent state must run on a Consent Initialization trigger. GTM ships a special trigger — Consent Initialization - All Pages — that fires before the normal All Pages trigger and before any other tag. Put your default gtag('consent', 'default', ...) logic (via a Custom HTML tag or a dedicated consent template) on this trigger and nothing else. This guarantees defaults are set before GA4 or Ads tags evaluate.

2. Use a Google-certified CMP template. The practical, low-error path is to install a CMP from the GTM Community Template Gallery (Cookiebot, iubenda, Usercentrics, CookieYes, and others publish maintained templates). The template handles both the default and update calls and keeps them in sync with the banner UI. Hand-rolling the update logic in Custom HTML is possible but fragile.

3. Set built-in consent checks on your tags. In each tag's Advanced Settings → Consent Settings, GTM lets you require specific consent types before the tag fires. Google's own tags (GA4, Google Ads) are consent-aware by default — they read the signals automatically and adjust behavior, so you generally do not block them; you let them fire and self-adjust. For non-Google tags (Meta Pixel, TikTok, LinkedIn) that have no concept of Consent Mode, add Additional consent checks requiring ad_storage so GTM refuses to fire them until consent is granted.

That distinction trips people up constantly: Consent Mode adjusts Google tags; it does nothing for third-party tags. A Meta Pixel will fire regardless of your consent signals unless you also gate it with GTM's consent checks or your CMP's tag-blocking. Don't assume Consent Mode covers your whole tag stack.

Where each tag type gets its consent enforcement
Google tags read Consent Mode signals natively; third-party tags must be blocked by GTM/CMP.

Server-side GTM (a server container running in your own Google Cloud project) does not replace Consent Mode — it consumes the same signals. When you deploy a server container, the consent state established client-side travels with the request: the GA4 client-side tag reads the signals, and the event forwarded to your server container carries the consent context so downstream server-side tags (a server-side GA4 tag, a server-side Google Ads Conversion tag, the Meta Conversions API) can honor it.

The practical benefits of pairing server-side tagging with Consent Mode in 2026:

  • First-party context. Requests flow to a server on your own domain/subdomain, which improves cookie durability (longer-lived first-party cookies vs. short-lived JavaScript cookies capped by ITP) and reduces the impact of client-side ad-blockers on consented traffic. It does not, and must not, be used to circumvent a denied consent choice.
  • Data minimization at the edge. You can redact PII, drop parameters, or reshape payloads in the server container before anything reaches Google or Meta — useful for GDPR data-minimization obligations.
  • One place to enforce consent for many destinations. Rather than gating a dozen client-side pixels, you forward one consented event server-side and fan it out to destinations that each check the propagated consent state.

Server-side tagging adds real cost and operational overhead: you run a Cloud Run (or equivalent) service, and you own its uptime, scaling, and security. It is worth it for high-traffic sites, sites fighting significant client-side data loss, or teams that need the data-governance control — not for a small brochure site. Google Cloud costs for a modest server container commonly land in the low tens of dollars per month, scaling with request volume; confirm against current Cloud Run pricing before you budget.

A frequent misconception: Advanced mode does not magically restore the exact conversions you lost. When a user denies consent, Google receives only anonymous pings. It then uses machine learning — trained on the behavior of consenting users plus those anonymous signals — to estimate the conversions that non-consenting users likely produced, and reports them as modeled conversions in Google Ads and (as thresholded, modeled figures) in GA4.

Two things follow from this that matter for how you read your data:

  • Modeling requires threshold traffic. Google only models when it has enough consented conversions and enough denied-consent traffic to build a reliable estimate. Low-traffic accounts may see little or no modeling — there simply isn't enough signal. Google publishes eligibility thresholds; below them, you get raw consented data only.
  • BigQuery export reflects reality, not the model. If you export GA4 to BigQuery, the event-level rows are the actually collected, consented events. Modeled conversions live in the Google Ads and GA4 reporting surfaces; they are not injected as rows into your BigQuery export. Build your warehouse analysis on real events and treat modeled figures as a reporting-layer estimate. Conflating the two is one of the most common analytics mistakes we see in audits — worth a full analytics audit before you build attribution models on top of it.

Common mistakes and how to avoid them

  • Default set after the config tag. If gtag('config', 'G-XXXX') or your GA4 tag runs before the consent default block, the very first pageview leaks in the wrong state. Defaults must be first, always — hence the Consent Initialization trigger in GTM.
  • Forgetting ad_user_data / ad_personalization. Sites that implemented v1 in 2022 and never updated are, by definition, non-compliant for EEA ad features. Both v2 signals must be present.
  • Assuming Consent Mode blocks third-party pixels. It does not. Gate Meta/TikTok/LinkedIn separately.
  • No wait_for_update, or a value too low. A slow CMP means the update lands after the tag already decided, so consented pageviews look denied. Measure your banner's real load time and set the window above it.
  • Using a non-certified CMP for EEA ads. For EEA users, Google requires a Google-certified CMP integrated with the IAB TCF or Google's Additional Consent framework to keep ad features running. A homemade banner may satisfy your lawyer but can still cost you Google ad-platform features.
  • Testing only "Accept all." The denied and partial-consent paths are where bugs hide. Test all three.

Validating your implementation

Never trust a Consent Mode setup you haven't watched behave. Use these tools, in order:

  1. GTM Preview / Tag Assistant. Load your site through GTM's preview mode and inspect the Consent tab on each event — it shows the on-page consent state and which tags were blocked or allowed. Confirm defaults are all denied on the very first hit.
  2. Browser dev tools → Network. Filter for /collect (GA4) and google-analytics/googleads requests. Before consent, inspect the request: with Consent Mode active you'll see the consent parameters (e.g. gcs=G100 for all-denied, G111 for all-granted) and, in Advanced mode, cookieless pings with no client-side cookies set.
  3. The gcs and gcd parameters. The gcs string encodes the consent state Google received on that hit; gcd (added for v2) encodes the default-vs-update and ad-data details. Reading these confirms the actual signal Google saw, not just what your banner claims.
  4. GA4 DebugView + Google Ads diagnostics. Over a few days, check that GA4 shows the expected consented-vs-modeled split and that Google Ads' consent-mode diagnostics (in the account's setup/consent area) report a healthy default and update rate.

If any of these disagree with what your banner shows, trust the network request — it is the ground truth of what Google actually received.

Getting Consent Mode v2 right is equal parts legal, technical, and measurement work, and the failure modes are quiet — you rarely get an error, you just slowly lose remarketing reach and conversion accuracy. If you'd like a specialist to implement it end-to-end (CMP selection, GTM wiring, server-side tagging, and validation) or to pressure-test an existing setup, that's exactly the kind of engagement our ongoing analytics services and structured onboarding are built for. You can review engagement tiers and pricing, or book a call to talk through your stack. And if you only want to know whether your current implementation is compliant and lossless, start with a free analytics audit — it flags consent, tagging, and data-loss issues before they compound.

FAQ

Consent Mode itself is not a legal requirement — GDPR requires that you obtain and honor consent, which your CMP does. However, Google contractually requires Consent Mode v2 signals (ad_user_data and ad_personalization) for EEA, UK, and Swiss traffic if you want to keep using remarketing audiences and personalized advertising in Google's ad products. Without it, those features are suppressed for that traffic. So it is not a law, but for advertisers targeting Europe it is effectively non-optional.

Basic mode blocks Google tags entirely until the user consents — no data, no pings, and weak conversion modeling because Google sees nothing from non-consenting users. Advanced mode loads tags immediately with everything defaulted to denied and sends anonymous, cookieless pings even from users who decline, which fuels much stronger conversion modeling. Advanced recovers more measurement; Basic sends less data. The choice is a privacy-vs-measurement trade-off your legal team should approve.

No. Consent Mode only adjusts the behavior of Google's own tags (GA4, Google Ads). Third-party tags like Meta Pixel, TikTok, and LinkedIn have no awareness of Consent Mode signals and will fire regardless. You must gate them separately — either with GTM's built-in consent checks (requiring ad_storage before they fire) or with your CMP's tag-blocking feature.

Not exactly. When users deny consent, Google receives only anonymous pings and then models the likely conversions using machine learning trained on consenting users' behavior. These appear as modeled conversions in Google Ads and GA4 reporting. Modeling requires a threshold volume of traffic and conversions, so low-traffic accounts may see little recovery. Crucially, modeled conversions are estimates in the reporting layer — they are not written into your GA4 BigQuery export, which only contains real, consented events.

Defaults first, always. The gtag('consent', 'default', ...) call — with signals set to their pre-consent state (denied for EEA) — must execute before any GA4 or Google Ads tag and before your CMP's own gtag calls. In GTM, this lives on the Consent Initialization - All Pages trigger. Only after the user chooses does gtag('consent', 'update', ...) flip the granted signals on. Use wait_for_update so a slow banner still gets its update in before tags decide how to behave.

Use GTM Preview / Tag Assistant to inspect the Consent tab per event and confirm all signals default to denied on the first hit. Then open browser dev tools, watch the network requests to Google's collection endpoints, and read the gcs parameter (e.g. G100 = all denied, G111 = all granted) plus the gcd parameter for v2 detail — these show the actual consent state Google received. Finally, check GA4 DebugView and Google Ads' consent diagnostics over a few days for a healthy default-and-update rate. If the network request disagrees with your banner, trust the request.

L

Layer Analytics

Senior GA4, Google Tag Manager, and BigQuery practitioners. We build measurement that marketing teams can actually trust. See what we do →

Keep reading