Consent Mode
The Google
Consent Mode allows you to adjust Google tracking based on user consent.
When users update their consent preferences via a Consent Management Platform
(CMP), it triggers a gtag('consent', ...)
call to inform Google about allowed
tracking categories:
// CMP triggers this when consent preferences change
gtag('consent', 'update', {
ad_storage: 'granted', // or 'denied'
analytics_storage: 'granted', // or 'denied'
});
The initial consent default
event is ignored by default.
Mapping
The consent update
event is mapped by default to the walker consent
event.
The consent states granted
and denied
are mapped to true
and false
respectively.
The following example shows the default mapping and the resulting
walker consent
event:
Configuration
Event
Result
note
The consent update
mapping is always set by default.