Sub topic 10
Consent mode and ads personalization controls
This chapter assumes you know GA4 events, users, the Admin area, cookies, and consent requirements such as GDPR. You should also understand that a consent banner records a decision, while consent mode sends that decision to Google tags.
Consent mode working model
Consent mode is a signaling system for Google tags. It does not replace a consent management platform or decide whether consent is legally required. Your banner or consent management platform must collect the decision. Your site then sends the current state to Google.
The main consent signals are:
| Signal | Controls |
|---|---|
| `analytics_storage` | Analytics cookies and related storage |
| `ad_storage` | Advertising cookies and related storage |
| `ad_user_data` | Whether user data may be sent to Google for advertising purposes |
| `ad_personalization` | Whether data may be used for personalized advertising |
Set conservative defaults before Google tags load. Update the values after the visitor makes a choice.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Run before the Google tag loads.
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied'
});
// Run after the visitor accepts the relevant purposes.
gtag('consent', 'update', {
analytics_storage: 'granted',
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted'
});The example grants every purpose after one broad acceptance. In production, map each banner choice to the correct signal. For example, a visitor might grant analytics storage but refuse advertising storage and personalized advertising.
Google signals and ads personalization
Google signals adds information from users who are signed in to Google and have enabled Ads Personalization. When eligible, it can support cross-device reports, demographics and interests reporting, and audience features. It does not identify every visitor or turn anonymous users into named people.
You enable Google signals at the property level in GA4. The setting is a broad property decision, while consent mode provides per-user signals. If Google signals is disabled for the property, consent alone does not activate it. If it is enabled, a user's consent choices and Google settings still limit how the data can be used.
Consider these trade-offs:
- Enable it when cross-device analysis and advertising audiences justify the additional privacy impact.
- Leave it disabled when your policy, legal review, or business need does not support those uses.
- Document the decision, affected regions, consent purposes, and review date.
- Expect smaller eligible populations when users decline advertising purposes.
ad_personalization: denied tells Google not to use the user's data for personalized advertising. This is different from analytics_storage: denied, which concerns analytics storage. A visitor can allow measurement while refusing personalized advertising.
Check behavior and keep an audit trail
Test each consent path in a clean browser session. Confirm that defaults run before the Google tag, updates use the visitor's actual choices, and later changes are sent again. Check tag requests and GA4 DebugView where available. Also review the property setting for Google signals and the advertising features connected to the property.
Record:
- The default consent state and regional exceptions.
- The mapping from banner purposes to consent signals.
- Whether Google signals is enabled.
- Who approved the configuration and when it will be reviewed.
- How consent withdrawal is handled.
Consent mode limits future collection and use. It does not remove historical data. Use a separate GA4 data deletion request when stored data must be removed.
Exercise
A visitor accepts analytics cookies but rejects advertising cookies and personalized advertising. Which signals should be granted?
Show answer
Grant analytics_storage only. Keep ad_storage, ad_user_data, and ad_personalization denied unless the visitor separately grants those purposes.