0Pricing
Digital Marketing Academy · Lesson

Consent Mode and CMPs

Respect user choices.

Consent Mode and CMPs is a free Digital Marketing Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Digital Marketing Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Why Consent Mode Exists

Under GDPR and ePrivacy, you generally need explicit consent before setting non-essential cookies or sharing data for advertising. But blocking all tags when consent is denied means losing measurement entirely.

Google Consent Mode is a bridge: tags read the user's consent choices and adjust their behavior, sending either full data, privacy-preserving signals, or nothing at all.

The Consent Signals

Consent Mode v2 defines four key states. Two existed before: analytics_storage and ad_storage. Two were added for v2: ad_user_data and ad_personalization.

Each is either 'granted' or 'denied'. ad_user_data governs whether user data may be sent to Google for ads; ad_personalization governs whether it may be used for personalized advertising and remarketing.

Consent Mode v2 parameters
--------------------------------------
analytics_storage    -> GA4 cookies
ad_storage           -> ad cookies
ad_user_data         -> send data to
                        Google for ads
ad_personalization   -> use data for
                        remarketing

Values: 'granted' | 'denied'

Default vs Update

The flow has two steps. First, a default command runs before any tags fire, usually setting everything to denied for EU users. Then, after the user clicks the banner, an update command reflects their actual choice.

Setting the default before tags load is critical, otherwise tags may fire with full tracking before consent is captured, which is a violation.

Consent state example (gtag)
--------------------------------------
// 1) default - BEFORE any tags
gtag('consent','default',{
  ad_storage:'denied',
  ad_user_data:'denied',
  ad_personalization:'denied',
  analytics_storage:'denied',
  wait_for_update: 500
});

// 2) update - after banner click
gtag('consent','update',{
  ad_storage:'granted',
  ad_user_data:'granted',
  ad_personalization:'granted',
  analytics_storage:'granted'
});

Basic vs Advanced Mode

Basic Consent Mode blocks Google tags entirely until consent is granted; no pings are sent before. Advanced Consent Mode loads tags immediately but, when consent is denied, sends cookieless 'pings', anonymous signals with no identifiers.

Advanced mode feeds Google's conversion modeling, which estimates the conversions you cannot observe directly. It usually recovers more data, but is a bigger compliance discussion.

Cookieless Pings

In advanced mode with consent denied, Google still receives a minimal, cookieless ping: a timestamp, page URL, the consent state itself, and a random identifier that is not stored.

These pings carry no personal data and set no cookies, so they can be defensible. They give Google's models enough aggregate signal to estimate the unobserved conversions.

Denied-consent cookieless ping
--------------------------------------
SENT (no cookies, no user id):
  - consent: ad_storage=denied
  - timestamp
  - page_location
  - random non-stored token

NOT SENT:
  - client_id / cookies
  - user identifiers
  -> feeds conversion modeling

What a CMP Is

A Consent Management Platform (CMP) is the tool that shows the banner, records the user's choices, stores proof of consent, and exposes that choice to your tags.

Examples include Cookiebot, OneTrust, Usercentrics, and Didomi. The CMP is the source of truth for consent; Consent Mode is how Google's tags react to it.

Google-Certified CMPs

For Consent Mode v2, Google requires a certified CMP for products like Google Ads remarketing and EEA traffic. A certified CMP integrates the v2 signals correctly and is on Google's approved list.

The CMP must pass the four consent parameters and integrate with the IAB Transparency and Consent Framework (TCF) where applicable. Using an uncertified or hand-rolled banner risks features being disabled.

The IAB TCF

The IAB Transparency and Consent Framework is an industry standard that encodes consent into a 'TC string', a compact token listing which purposes and vendors the user allowed.

Ad tech partners read the TC string to know if they may process data. Many CMPs emit it automatically; it is heavy machinery, so smaller sites often use a lighter Google-certified setup without full TCF.

TC string (conceptual)
--------------------------------------
TCString: CPxyz... (base64)
  encodes:
   - consent purposes 1..10
   - legitimate interest flags
   - vendor allow-list
   - publisher restrictions

Vendors decode it to decide:
  'may I process this user's data?'

Wiring CMP to Tags

The integration pattern: the CMP loads first and sets the Consent Mode default to denied. When the user chooses, the CMP triggers the consent update and fires a dataLayer event.

Your GTM tags then either react to Consent Mode automatically (built-in consent checks) or use triggers gated on the consent event. Order matters: CMP before GTM, default before update.

Load order (must be exact)
--------------------------------------
1. CMP script loads
2. consent 'default' = denied
3. GTM / gtag loads
4. user clicks banner
5. CMP fires consent 'update'
6. dataLayer.push({event:'consent_ready'})
7. gated tags now fire

Wrong order = tags fire pre-consent = breach

Consent in Server-Side

Consent travels with the event into your tagging server. Each server-side tag can check the consent state in the payload before forwarding to a destination.

So even after the browser, a denied ad_user_data signal should stop the Meta CAPI or Google Ads tag from sending. Consent enforcement must exist on both client and server.

Compliance and Trust

Done right, Consent Mode plus a certified CMP lets you respect choices and still measure, through modeling, without setting unauthorized cookies. Done wrong, it becomes a fig leaf over illegal tracking.

Audit regularly: confirm defaults are denied, banners offer a genuine reject option, proof of consent is logged, and no identifying tags fire before consent.

Quick Check

Test your understanding of Consent Mode and CMPs.

Recap

Consent Mode v2 uses four signals (analytics_storage, ad_storage, ad_user_data, ad_personalization) set to granted or denied, with a denied-by-default then update flow. Advanced mode sends cookieless pings on denial to power modeling.

A Google-certified CMP is the source of truth that shows the banner, records consent, and feeds these signals (and the IAB TC string). Enforce consent on both client and server, and audit that defaults are denied before any tag fires.

Frequently asked questions

Is the “Consent Mode and CMPs” lesson free?

Yes — the full text of “Consent Mode and CMPs” is free to read here on the web, and the Digital Marketing Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Digital Marketing Academy course, upgrade to CoddyKit PRO.

What will I learn in “Consent Mode and CMPs”?

Respect user choices. You practise Digital Marketing Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Digital Marketing Academy?

No prior experience is required. Digital Marketing Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Consent Mode and CMPs” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Digital Marketing Academy lesson?

Yes. Every Digital Marketing Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Tracking Broke
  2. Server-Side Tagging
  3. Consent Mode and CMPs
  4. First-Party Data Strategy
← Back to Digital Marketing Academy