If you have implemented Google Analytics or Google Ads on a website, you have probably encountered Google Consent Mode v2.
But here is a common implementation misunderstanding:
Google Consent Mode is not a cookie consent banner.
It does not ask users for permission, render a preference centre or independently decide which third-party scripts should execute. It receives consent states from an existing consent solution and changes the behaviour of supported Google tags.
Let's break down the architecture.
1. Cookie Consent Is the Input Layer
A consent banner or CMP is responsible for collecting user preferences.
A typical preference model might look like:
{
necessary: true,
analytics: false,
advertising: false,
personalization: false
}
This is an illustrative application-level model, not a Google Consent Mode payload.
The CMP can persist preferences, expose a preference centre, manage categories and trigger integrations when a user changes their selection.
2. Consent Mode Is the Google Signalling Layer
Google Consent Mode translates relevant user choices into Google consent states.
The four important Consent Mode v2 signals are:
{
ad_storage: "denied",
analytics_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied"
}
These are illustrative defaults. Your actual mapping must reflect the visitor's choices, applicable requirements and implementation design.
Other supported signals include functionality_storage, personalization_storage and security_storage.
Official reference: https://developers.google.com/tag-platform/security/concepts/consent-mode
3. The Integration Flow
A practical architecture looks like this:
Visitor
|
v
Consent Banner / CMP
|
| Collect preferences
v
Consent Mapping
|
| Convert choices into Google consent states
v
Google Consent Mode API
|
v
Google Tags / SDKs
|
v
Behaviour adjusted to consent state
The CMP is the source of the visitor's preferences. Consent Mode is the mechanism that communicates relevant states to Google.
4. Basic vs Advanced Mode
Basic Mode
- Google tags are blocked until the visitor interacts with the banner.
- If consent is granted, tags load and receive the relevant consent state.
- If consent is not granted, the blocked Google tags do not send data to Google.
Advanced Mode
- Google tags load with configured default consent states.
- Defaults are commonly set to denied until the visitor makes a choice.
- Supported tags may send cookieless pings while relevant storage consent is denied.
- Tags update their behaviour when the CMP communicates the visitor's choice.
Advanced mode is not equivalent to granting permission. It changes tag behaviour under denied defaults and should be assessed against the site's privacy requirements.
5. Implementation: Set Defaults Before Tags
With a direct gtag.js implementation, a simplified default command looks like this:
gtag("consent", "default", {
ad_storage: "denied",
analytics_storage: "denied",
ad_user_data: "denied",
ad_personalization: "denied"
});
When the user makes a choice, the consent solution must send an update reflecting that choice:
gtag("consent", "update", {
ad_storage: "granted",
analytics_storage: "granted",
ad_user_data: "granted",
ad_personalization: "denied"
});
These snippets are examples only. Do not copy the granted values blindly. The CMP should map the actual visitor selection to the appropriate signals.
Google's implementation guide: https://developers.google.com/tag-platform/security/guides/consent
6. What Consent Mode Does Not Handle
Consent Mode does not automatically block every script on your page.
Consider a typical marketing stack:
| Technology | Consent handling |
|---|---|
| Google Analytics | Google Consent Mode supported |
| Google Ads | Google Consent Mode supported |
| Meta Pixel | Requires its own consent-aware integration |
| LinkedIn Insight Tag | Requires its own consent-aware integration |
| TikTok Pixel | Requires its own consent-aware integration |
| Embedded video | Review the provider and implementation |
| Chat widget | Review its storage and processing behaviour |
A CMP may offer prior-script blocking or category-based script controls. Those controls need to be configured and tested independently of Google's consent signals.
7. Common Developer Mistakes
Loading tags before defaults: Consent defaults should be established before Google tags use or update consent.
Using useEffect without considering execution order: In React, an effect may execute after the initial render. If tracking scripts have already executed, a late consent update may not prevent the initial behaviour.
Mapping categories incorrectly: A visitor's analytics preference should not automatically grant advertising-related consent.
Ignoring withdrawal: When a visitor changes preferences, the updated state should reach the relevant integrations.
Assuming every script is controlled: Google Consent Mode is not a universal script blocker.
8. How to Test
Use Google Tag Assistant to inspect the Consent tab and verify:
- Consent defaults are present.
- Defaults are set before tags use consent.
- The banner sends updates after user interaction.
- Google tags respond to the updated states.
- Rejection and withdrawal paths work as expected.
Google troubleshooting guide: https://support.google.com/tagmanager/answer/14522438
9. Where Does a CMP Fit?
A CMP manages the user-facing consent experience and can connect preferences to multiple technologies.
For example, ConsentX lists Google Consent Mode v2 support. Its features and integrations pages are useful starting points when evaluating the platform. Confirm the current implementation instructions in your account before deployment.
Final Takeaway
Think of the architecture in two layers:
- CMP: collects, stores and manages visitor preferences.
- Google Consent Mode: communicates relevant preferences to supported Google tags.
You need to integrate the two correctly. Neither a consent banner alone nor Consent Mode alone should be treated as a complete solution for every script and privacy obligation.
Build the consent flow first, map the states carefully, and test the actual network and tag behaviour.
Top comments (0)