Sub topic 10
Consent mode and ads personalization controls
This chapter explains how consent signals from your site change what GA4 collects, and how ads personalization controls limit what Google signals data can be used for. It assumes you know the GA4 Admin area, understand events, parameters and users, and have a basic idea of cookies and consent rules such as GDPR. Retention, reporting identity and Google signals are covered in earlier chapters.
Two layers of control
GA4 privacy behavior comes from two separate layers that work together.
- Consent mode runs in the visitor's browser. It tells Google tags what they may store and use, based on the choice the visitor made in your consent banner.
- Admin settings run on the property. They include the Google signals toggle and the ads personalization controls. These apply no matter what the visitor chose.
A feature works only when both layers allow it. If Google signals is on but the visitor denied ad_personalization, that visitor's data is not used for personalization. If the visitor consented but your property has personalization turned off for their region, the property setting wins.
The four consent signals
Consent mode defines four parameters. Each is set to granted or denied.
| Parameter | What it controls |
|---|---|
| `analytics_storage` | Whether GA4 may write analytics cookies (such as `_ga`) and read them. |
| `ad_storage` | Whether Google tags may store advertising cookies. |
| `ad_user_data` | Whether user data may be sent to Google for advertising purposes. |
| `ad_personalization` | Whether the data may be used for personalized advertising, such as remarketing audiences. |
The last two were added in consent mode v2. Google requires them for ads features covering users in the European Economic Area and the UK. Sending only ad_storage and analytics_storage leaves the newer signals undefined, which can break audience and conversion features.
analytics_storage is the one that affects GA4 reporting most directly. When it is denied, GA4 does not set or read analytics cookies, so it cannot recognize a returning visitor.
Setting defaults and updates
The default must run before the Google tag loads. The update runs when the visitor makes a choice. Both calls use gtag('consent', ...).
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Run before the Google tag loads: deny everything until the user chooses.
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied'
});
// Run after the user accepts in your consent banner.
gtag('consent', 'update', {
analytics_storage: 'granted',
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted'
});In a real site the second call sits inside your banner's accept handler, not at page load. If you use a consent management platform (CMP), it usually issues both calls for you. Check the order in your page source.
Regional defaults and waiting for the banner
You can set different defaults per region with the region parameter, which takes ISO 3166-2 codes. Two details matter in practice:
- A call with
regionis more specific than a call without it, so it overrides the global default for visitors in that region. wait_for_updategives an asynchronous CMP time, in milliseconds, to load a returning visitor's saved choice before tags fire.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Deny by default in Spain and Germany, and wait up to 500 ms for the CMP.
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
region: ['ES', 'DE'],
wait_for_update: 500
});
// Everywhere else, allow analytics but keep advertising off.
gtag('consent', 'default', {
analytics_storage: 'granted',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied'
});Basic and advanced implementation
Consent mode has two implementation styles. They differ in what happens when a visitor denies consent.
| Aspect | Basic | Advanced |
|---|---|---|
| Google tags before consent | Blocked from loading | Load right away with denied defaults |
| Data sent while denied | None | Cookieless pings without cookies or persistent identifiers |
| Behavioral modeling in GA4 | Not available | Available if thresholds are met |
| Typical setup | CMP blocks tags until a choice is made | Tags load first, consent state is applied |
In advanced mode, the cookieless pings carry limited information, such as that an event happened, with no cookie ID. GA4 can use these pings to model some of the behavior of visitors who denied consent. Modeled data fills part of the gap in your reports. It is an estimate, not a record of individual users.
Behavioral modeling needs enough volume to train on. Google's documentation states thresholds of at least 1,000 events per day with analytics_storage denied for at least 7 days, and at least 1,000 daily users sending events with it granted for at least 7 of the previous 28 days. Check the current documentation for exact numbers, as they can change.
Ads personalization controls in GA4
Consent mode is only half of the picture. GA4 also has its own switches for personalized advertising.
- Google signals. In Admin, under Data collection, you activate or deactivate Google signals for the property. Turning it off removes the cross-device and demographic data that signals provides.
- Regional controls. In the data stream's tag settings, you can disable ads personalization for specific countries or regions. Events from those regions are still collected, but they are not used for personalized ads. The menu path has moved between interface updates, so look for the ads personalization setting in the stream's configuration.
- Per-event and per-user controls. In code, you can switch off personalization for a single page, event or user.
// Disable ads personalization for everything sent from this page.
gtag('set', 'allow_ad_personalization_signals', false);
// Or for one event only.
gtag('event', 'sign_up', {
allow_custom_scripts: true,
allow_ad_personalization_signals: false
});Use these code-level controls when you know something about the visitor that the banner does not capture, such as a user who opted out in your account settings, or content aimed at children.
How consent interacts with Google signals
Google signals relies on users who are signed in to a Google account and have ads personalization turned on. Consent mode adds a second condition: the visitor on your site must also have allowed it.
- With
ad_personalizationdenied, a visitor's signals data does not feed remarketing audiences, even if signals is active on the property. - With
analytics_storagedenied, GA4 has no cookie to identify the visitor across sessions. The visitor appears as separate, unconnected activity, or is covered only by modeling. - Thresholding, covered in the previous chapter, can still apply. Fewer identifiable users in the data can lead to more hidden rows.
A common surprise is that user counts fall after you add a consent banner. This is expected. Visitors who decline no longer produce persistent IDs, so your reports count fewer unique users and more sessions that look like new users.
Consent and data that is already collected
Consent changes affect future collection. They do not reach back into stored data. If a visitor withdraws consent, the update call stops further storage and use from that point. Events already collected stay in the property until retention expires them, or until you submit a data deletion request, which is the topic of a later chapter. Plan your withdrawal flow with that in mind: stopping collection and erasing stored data are two separate steps.
Verifying your setup
Check the implementation before relying on it.
- Open the page with the browser's developer tools and look at the cookies before you interact with the banner. No
_gacookie should exist whileanalytics_storageis denied. - Inspect the network requests to the Google collection endpoint. Google tags add a consent state parameter to the requests, and this should match the choice you made. In advanced mode, you should see requests with no cookie ID.
- Accept, then reload. Confirm that the cookie now exists and that the update was applied before the page view event fired.
- Use Tag Assistant or GA4 DebugView to see the consent state attached to each event.
If the default call comes after the tag has loaded, the tag may fire with its own defaults first. This ordering mistake is the most common implementation error.
Common errors
- Setting the default after the tag loads, so early events ignore consent.
- Omitting
ad_user_dataandad_personalization, so EEA audiences and conversions do not work as expected. - Granting everything in a regional default that should be opt-in.
- Expecting modeling in basic mode, or when volume is below the thresholds.
- Treating the personalization switch as an analytics switch, or the reverse.
Exercise
A property has Google signals turned on. A visitor in Germany declines your banner, so analytics_storage and ad_personalization are both denied. You use advanced consent mode. What does GA4 receive for that visitor, and can the visitor appear in a remarketing audience?
Show answer
GA4 receives cookieless pings with no persistent identifier, because advanced mode loads the tag even when consent is denied. These pings can contribute to behavioral modeling if the volume thresholds are met, but they do not identify the visitor. The visitor cannot appear in a remarketing audience, because ad_personalization is denied and no cookie links the visits together, even though Google signals is active on the property.
Exercise
After you launch a consent banner, reported users drop by 30% but sessions stay about the same. Is this a bug? Name one thing you would check in the implementation.
Show answer
Not necessarily. Visitors who decline lose their persistent IDs, so fewer users can be recognized across sessions and more of them look like new users. Check that the gtag('consent', 'default', ...) call runs before the Google tag loads and that the update fires when the visitor accepts. A late default or a missing update would cause an extra drop that is a real bug.