GA4 Consent Mode v2
How PixelsCleared sends Google Analytics Consent Mode v2 signals.
What Is Consent Mode v2
Google Analytics Consent Mode v2 is a framework that communicates visitor consent choices to Google's advertising and analytics products. Since March 2024, Google requires Consent Mode v2 signals for websites serving visitors in the EU and EEA. Without these signals, Google may restrict data collection and modeling for your property.
Consent Mode v2 introduces two consent signals beyond the original ad_storage and analytics_storage:
ad_user_data-- Controls whether user data (such as email or phone) can be sent to Google for advertising purposesad_personalization-- Controls whether Google can use data for personalized advertising
PixelsCleared sends both signals with every event forwarded to GA4. No additional setup is required on your end.
How PixelsCleared Sends Consent Signals
The gateway's GA4 forwarder reads the categories.marketing field from the _consent_meta object attached to each event and translates it into Consent Mode v2 parameters:
| Consent State | consent.ad_user_data | consent.ad_personalization |
|---|---|---|
| marketing: true | "granted" | "granted" |
| marketing: false or absent | "denied" | "denied" |
| Unknown (no _consent_meta) | "denied" (conservative default) | "denied" (conservative default) |
These values are sent as part of the GA4 Measurement Protocol payload alongside the event data.
Example: Marketing Consent Granted
Widget sends:
{
"event": "page_view",
"consent": true,
"_consent_meta": {
"granted": true,
"source": "onetrust",
"categories": {
"marketing": true,
"analytics": true
}
}
}
Gateway forwards to GA4:
{
"client_id": "gateway.abc123",
"consent": {
"ad_user_data": "granted",
"ad_personalization": "granted"
},
"events": [{
"name": "page_view",
"params": {}
}]
}
Google receives full consent signals and processes the event without restrictions.
Example: Marketing Consent Denied
Widget sends:
{
"event": "page_view",
"consent": true,
"_consent_meta": {
"granted": true,
"source": "onetrust",
"categories": {
"marketing": false,
"analytics": true
}
}
}
Gateway forwards to GA4:
{
"client_id": "gateway.abc123",
"consent": {
"ad_user_data": "denied",
"ad_personalization": "denied"
},
"events": [{
"name": "page_view",
"params": {}
}]
}
Google will restrict advertising features for this event. Analytics data may still be collected depending on your GA4 property settings, but ad personalization and user data sharing are disabled.
Conservative Defaults
When _consent_meta is absent or the marketing category is missing, the gateway defaults to "denied" for both signals. This is the safe default required by Google for EU/EEA traffic. It ensures that:
- Your GA4 property remains compliant with Google's consent requirements
- You do not risk data collection restrictions from Google's side
- Modeling and behavioral insights continue to function (Google uses modeled data when consent is denied)
No Extra Setup Needed
Consent Mode v2 signals are derived from the same consent meta that the widget already sends with every event. There are no additional configuration steps:
- Your consent banner detects consent (or you use the Manual Consent API)
- The widget attaches
_consent_metato each event - The gateway translates categories into
consent.ad_user_dataandconsent.ad_personalization - GA4 receives the consent signals with the event
If you have a GA4 destination connected and events are flowing, Consent Mode v2 is already active.
How This Differs From Browser-Side Consent Mode
Traditional Consent Mode v2 is implemented by loading gtag.js in the browser and calling gtag('consent', 'default', ...) before any Google tags fire. PixelsCleared replaces that entire flow:
- No
gtag.jsloads in the browser. The widget sends events to your first-party subdomain, not to Google. - No
gtag('consent', ...)calls needed. The gateway sets consent parameters server-side in the Measurement Protocol payload. - Consent signals are attached per-event. Each event carries its own consent state, so if a visitor changes their mind mid-session, subsequent events reflect the updated consent.
This means you can remove the gtag.js consent default snippet from your site entirely. PixelsCleared handles it at the server level.
Verifying Consent Signals in GA4
To confirm that consent signals are being received:
- Open Google Analytics and go to Admin > Data Streams > your web stream.
- Click Events and look at recent events in real-time.
- Check the event parameters for
consentfields. - Events from visitors who denied marketing consent should show
ad_user_data: denied.
You can also use the GA4 DebugView to inspect individual event payloads in real time.