Sub topic 2
The Consent Mode v2 Signals and What Each Controls
Prerequisites
This chapter assumes you can read a GA4 property's reports, you know what a cookie is, and you have used gtag.js or Google Tag Manager (GTM) at least once. It also assumes you know that privacy laws such as GDPR and ePrivacy require consent for some tracking. The chapter covers each signal, how the signals combine, and the mistakes that most often break them. Basic versus advanced mode, the data GA4 receives when consent is denied, and modelling come in later chapters.
Consent Mode is a signal channel, not a banner
Consent Mode does not show a banner, store the visitor's choice, or decide what the law requires. Your consent management platform (CMP) or your own banner does those jobs. Consent Mode is the interface between that banner and Google's tags. Your page tells the tags, in four named signals, what the visitor has allowed. The tags then change what they read, write and send.
Each signal has one of two values, granted or denied. Four signals make up Consent Mode v2:
analytics_storagead_storagead_user_dataad_personalization
The first two existed in the original Consent Mode and control storage on the visitor's device. The last two were added in v2 and control what data may be sent to Google and how it may be used. Google requires them for using advertising features with traffic from the European Economic Area (EEA). If your banner only sets the first two, the v2 requirement is not met.
The four signals at a glance
| Signal | Controls | Effect when denied |
|---|---|---|
| `analytics_storage` | Reading and writing analytics cookies such as `_ga` and `_ga_<container-id>` | GA4 does not store a client ID on the device, so it cannot recognize a returning visitor from cookies |
| `ad_storage` | Reading and writing advertising cookies, such as the Google Ads cookies set on your domain | Advertising cookies are not set or read, which limits click and conversion attribution for ads |
| `ad_user_data` | Whether user data related to advertising may be sent to Google | User data is not sent to Google for advertising purposes |
| `ad_personalization` | Whether data may be used for personalized advertising, such as remarketing | Data is not used for remarketing or other personalized ads |
analytics_storage
This is the signal that matters most for GA4 reports. It governs the first-party cookies that GA4 uses to recognize a browser across page views and visits. With the signal granted, the Google tag sets the client ID cookie. GA4 can then count a returning user, tie events into a session, and measure engagement over time.
With the signal denied, the tag does not read or write those cookies. Whether any hit is sent at all depends on basic versus advanced mode, which the next chapter covers. The denied state is the root of most of the gaps you will see in user counts, session counts and attribution.
ad_storage
This signal governs advertising cookies, not GA4's own analytics cookies. It matters to GA4 in two ways. Google Ads conversion linking and click identifiers depend on those cookies, so denying the signal weakens attribution from ad clicks to on-site events. Some GA4 advertising features also depend on it.
Two signals with similar names can be confused. ad_storage is about the device. ad_user_data is about what leaves the device.
ad_user_data
This signal sets consent for sending user data to Google for advertising purposes. Examples are linking GA4 events to Google Ads for conversion measurement, and exporting audiences. A visitor can allow cookies but still deny this, and your tags must respect that.
ad_personalization
This signal sets consent for personalized advertising. It decides whether a visitor's data may feed remarketing and other personalization. Denying it does not stop analytics or non-personalized ads measurement. It restricts only the personalization use.
How the signals combine
The signals are independent. A visitor can be granted on one and denied on another, and the banner's categories usually map onto them like this:
- An "Analytics" category sets
analytics_storage. - A "Marketing" or "Advertising" category sets
ad_storage,ad_user_dataandad_personalization, often all together.
Mapping all three advertising signals to one toggle is common but not required. If your banner offers a separate choice about personalized ads, set ad_personalization separately.
Setting the signals
Two commands exist. default declares the state before any Google tag runs. update changes it after the visitor chooses. In the update call you can include only the signals that changed. Signals you leave out keep their current value.
The default call must run before any Google tag loads, and wait_for_update tells tags to hold for a short time (in milliseconds) so a fast banner can send an update before the first hit.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
// Must run before any Google tag loads.
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
});A banner with separate analytics and marketing toggles can send each choice on its own:
// Map banner categories to Consent Mode v2 signals.
function applyChoices(choices) {
gtag('consent', 'update', {
analytics_storage: choices.analytics ? 'granted' : 'denied',
ad_storage: choices.marketing ? 'granted' : 'denied',
ad_user_data: choices.marketing ? 'granted' : 'denied',
ad_personalization: choices.personalizedAds ? 'granted' : 'denied'
});
}
// Example: analytics and marketing allowed, personalized ads refused.
applyChoices({ analytics: true, marketing: true, personalizedAds: false });The values are the strings 'granted' and 'denied'. Booleans such as true and false are not valid values.
Regional defaults
You can apply different defaults by region with the region parameter, which takes ISO 3166 country or subdivision codes. The region-specific default takes precedence over the general one for visitors in the listed regions.
// Stricter default for specific regions (ISO 3166 country or subdivision codes).
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
region: ['ES', 'DE', 'FR']
});
// Default for everywhere else.
gtag('consent', 'default', {
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
analytics_storage: 'granted'
});Whether a granted default is acceptable outside those regions is a legal decision for you and your advisers, not a technical one.
Persistence across pages
gtag.js does not remember the visitor's choice between page loads. On every page, your code must call default first and then call update with the stored choice as early as it can. Most CMPs and the GTM consent templates do this for you. A hand-built banner must do it explicitly. If it does not, a returning visitor who accepted cookies is treated as denied until the banner fires again.
Reading the state in network requests
You can see the consent state on the wire. GA4 requests to the /g/collect endpoint carry a gcs parameter. It has the form G1 followed by two digits. The first digit is the ad_storage state and the second is the analytics_storage state, where 1 means granted and 0 means denied.
| `gcs` value | `ad_storage` | `analytics_storage` |
|---|---|---|
| `G111` | granted | granted |
| `G100` | denied | denied |
| `G110` | granted | denied |
| `G101` | denied | granted |
A separate gcd parameter encodes the state of all the signals, including the v2 ones, in a more compact code. For a quick check, gcs is easier to read, but it does not show ad_user_data or ad_personalization.
Common errors
- Default set too late. If a Google tag loads before the
defaultcall, it starts with no denied state, and the first hit can be sent as if consent were granted. Place the default call at the top of the page or in a GTM trigger that fires before any tag (the Consent Initialization trigger). - Only two signals set. A signal with no default or update has no denied state, so the tag behaves as if it were granted. Set all four explicitly.
- Wrong value strings. Values such as
'true','accepted'or'allow'are not valid. Use'granted'and'denied'exactly. - Update never sent on later pages. See persistence above. This produces a steady drip of lost analytics from returning, consenting visitors.
- Treating Consent Mode as consent collection. The signals report a choice that your banner must actually collect. Setting them to
grantedwithout a real choice does not make tracking compliant. - Expecting an immediate, uniform effect. A signal changes behavior from the next hit onward. Hits already sent keep the state they were sent with.
Exercise
A visitor accepts analytics but refuses marketing. Your banner calls gtag('consent', 'update', { analytics_storage: 'granted' }) and nothing else. The default call earlier denied all four signals. Which signals are granted now, and what gcs value would you expect on the next GA4 hit?
Show answer
Only analyticsstorage is granted. The other three keep their default of denied, because an update with fewer signals leaves the omitted ones unchanged. The first digit after G1 is adstorage (denied, 0) and the second is analytics_storage (granted, 1), so the expected value is G101.
Exercise
A site loads the gtag.js snippet in the page head, then, 800 ms later, its consent banner script runs the default call with every signal set to 'denied'. Name the problem and give the fix.
Show answer
The Google tag loaded before the default call, so its first hits were sent without a denied state, as if consent were granted. The default call must run before any Google tag loads. Move it above the gtag.js snippet, or fire it from the Consent Initialization trigger in GTM. If the banner is slow, add waitforupdate so tags wait briefly for the visitor's stored choice.
Exercise
Which of the four signals decides whether GA4 sets the _ga client ID cookie, and which two decide what advertising data may be sent to Google or used for remarketing?
Show answer
analyticsstorage decides whether the ga cookies are set. aduserdata decides whether advertising-related user data may be sent to Google, and ad_personalization decides whether data may be used for personalized advertising such as remarketing.