LW IT Solutions logo LW IT Solutions logo LW IT Solutions
« Blog Overview /Digital Analytics / GA4 Consent Mode v2: The gcd Parameter,...
Read this article in other languages:

GA4 Consent Mode v2: The gcd Parameter, CMP Race Conditions and Server-Side Debugging

Part 3 of 4 in the series Wiring consent correctly

GA4 Consent Mode v2: The gcd Parameter, CMP Race Conditions and Server-Side Debugging
Contents
  1. Four signals with different purposes
  2. What gcs and gcd reveal
  3. Investigating a CMP race condition
  4. Fixing order and bounding the wait
  5. Distinguishing Basic and Advanced
  6. Following server traffic to each destination
  7. Questions and answers
  8. Sources

gcd is a diagnostic clue in Google requests. The parameter does not replace consent verification or inspection of outgoing data. With an asynchronously loaded consent management platform (CMP), the sequence matters: defaults, stored choice, update, measurement event and actual transmission.

Four signals with different purposes

Signal Meaning
ad_storage Storage for advertising, such as cookies.
analytics_storage Storage for analytics.
ad_user_data Sending user data to Google for online advertising.
ad_personalization Personalized advertising.

Analytics permission is not a general marketing permission. In particular, ad_user_data does not automatically authorize Meta CAPI. Other recipients and purposes need an explicit mapping to the choice actually collected.

Four stages of consent debugging: defaults, CMP update, browser request and destination-specific server output.
Four stages of consent debugging: defaults, CMP update, browser request and destination-specific server output.

What gcs and gcd reveal

Google describes gcs as carrying the states of ad_storage and analytics_storage. gcd carries more detailed consent information and is also sent without an active Consent Mode implementation. Its presence therefore does not establish correct configuration.

Google explicitly warns that encoded HTTP fields can change. Observed letter tables and fixed character positions are not a permanent documented interface. A check such as gcd.charAt(6) should not control permission to forward data. An apparently matching value proves neither valid consent nor a complete history of every decision.

Investigating a CMP race condition

An early request with a different consent pattern from later requests can indicate a delayed update. A normal later acceptance, regional differences or a partial update can also explain the change. Comparing requests alone does not establish the cause.

  1. A fresh Tag Assistant session establishes the earliest consent event and all four defaults.
  2. The record includes CMP initialization and any stored choice. The choice must match the current purposes and vendor configuration.
  3. All four update values are compared with the timing of the first measurement event.
  4. The affected tag’s consent checks and firing reason are linked to the corresponding browser request.
  5. The test matrix covers a new session, stored denial, stored acceptance, partial consent, withdrawal and a slow CMP, plus separate regional variants.

A defensible finding would be: a relevant stored acceptance existed, but the consent update was processed after the measurement event under investigation. That timeline distinguishes an ordering problem from a normal later decision.

Fixing order and bounding the wait

In GTM, suitable consent templates should set defaults on Consent Initialization – All Pages. Templates use setDefaultConsentState and updateConsentState. Calling gtag('consent', ...) inside a template can introduce queueing delays. Starting a template early still does not guarantee that an asynchronously loaded CMP has finished.

For direct gtag.js integration, defaults must precede measurement-producing config or event commands. wait_for_update provides a bounded waiting period for an update. The frequently shown 500 milliseconds is an example, not a reliable maximum CMP loading time. After expiry, the consent state available at that point applies.

A documented CMP event can support an appropriate firing strategy. An invented event name or an additional pageview on every consent change can instead lose or duplicate measurements. Firing, repeat events and navigation need joint testing.

Distinguishing Basic and Advanced

Basic Consent Mode blocks the relevant Google tags until the required consent. In Advanced Consent Mode, loaded Google tags can send limited pings without the relevant cookies following denial. Therefore, denied does not automatically mean no network traffic. A design requiring no corresponding transmission before consent needs verified blocking across every involved path.

Following server traffic to each destination

In Google’s documented setup, a GA4 client processes the incoming request in the server container, and consent-aware Google tags use the transported signals. Behavior varies by destination and tag. A GA4 request is not a mandatory carrier for every other server client or vendor.

Server preview should connect the incoming request, responsible client, generated event, fired tags and outgoing requests. Third-party templates need explicitly verified rules for each recipient and purpose. An externally supplied consent field is also not cryptographic proof of consent.

Missing or unintelligible signals should remain visible as a separate error condition and must not imply permission. A minimized test record can include the case, event time, tag version, firing decision and destination. Full URLs or user data should not enter diagnostic logs without checking the contents and need.

Questions and answers

Does missing gcd establish denial?

No. A different transport path may omit the parameter. The origin, client and expected format need investigation. Unknown and explicitly denied are different diagnostic states.

Does gcs prove that no cookies were written?

No. The parameter reports transported states. Actual cookie access and requests require additional browser and, where relevant, server inspection.

Does Consent Mode guarantee legal compliance?

No. Technical signals do not replace assessment of consent, purposes, recipients, payloads and retention. A successful test suite establishes only the tested flows and versions.

Sources

Wiring consent correctly

  1. How to Implement Google Consent Mode v2
  2. How Cookieless Pings Work in Google Consent Mode
  3. GA4 Consent Mode v2: The gcd Parameter, CMP Race Conditions and Server-Side Debugging
  4. How to Pass Consent Status to Server-Side GTM
Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in touch

A question or an idea for a web project? Tell me a little about it. This form uses reCAPTCHA to protect against spam.

Write a comment

Differing figures from other accounts and questions about the setup are welcome here.

The email address is not published. Required fields are marked with an asterisk.