Google Consent Mode v2
Configure direct-load and GTM-template consent commands and verify their runtime state.
CookieBeam sends Google Consent Mode v2 signals for Google tags. Other vendors do not consume these signals. Control them through blocking and category assignment.
Direct banner loading and loading through a GTM template use different startup sequences. Configure the path you deploy.
Category mapping
The base category mapping is:
| CookieBeam category | Consent Mode v2 keys |
|---|---|
necessary | security_storage |
functional | functionality_storage |
analytics | analytics_storage |
marketing | ad_storage, ad_user_data, ad_personalization |
preferences | personalization_storage |
A category not in this table maps to no key.
There is one compatibility rule. When the banner has no separate functional category, accepted preferences also grants functionality_storage. During default-state calculation, an accepted necessary category also grants functionality_storage when functional is absent.
Direct banner loading
The generated direct-load bundle enables a consent default command on load. The core integration can skip that command when setDefaultsOnLoad is false, but generated CookieBeam bundles currently set it to true.
For a visitor with valid stored consent, the default reflects the stored categories. A parseable, non-pending stored record can also supply its categories when it is invalid for the current configuration. When no stored categories are available through either path, the default starts from the banner's readOnly categories and the matched regional rule's Consent Mode default categories, then applies any explicit regional Consent Mode key overrides.
The default payload includes wait_for_update when the visitor does not have valid stored consent. The fallback is 2,000 milliseconds when no value is supplied. url_passthrough is not part of the consent payload. CookieBeam sends it separately with gtag('set', { url_passthrough: true }) when enabled.
Loading through a GTM template
The GTM template sets its own defaults. Without regional template settings, its conservative global fallback starts ad_storage, ad_user_data, ad_personalization, analytics_storage, and personalization_storage at denied, and starts functionality_storage and security_storage at granted. When regional template settings exist, the template issues each row's configured defaults instead; those fields can be granted. If no configured row is global, the template also adds the conservative global fallback.
The template also applies URL passthrough as a separate setting. The direct-load settings in the banner dashboard do not configure template defaults.
After the template default:
- A returning visitor with valid stored consent always receives a consent
updatefrom the runtime. - A new visitor receives an initial runtime
updateonly when explicit regional defaults exist and differ from the template defaults. - A visitor choice sends a consent
updatewith the resolved category state.
Configure and publish
For direct loading:
- Open the banner's App Integrations page.
- In Google Consent Mode, enable the integration and set Wait for Update, Ads Data Redaction, and URL Passthrough as needed.
- Click Save Consent Mode Settings.
- Publish the banner.
For a GTM-template installation, configure the initial defaults in the template instead. The banner's direct-load defaults do not replace them.
Verify commands
Use a clean browser profile and inspect window.dataLayer before and after a choice:
window.dataLayer
window.CookieBeamGTM?.getConsent()
A direct load should contain a consent default command. A returning template load should contain the template default followed by a runtime update. After a visitor choice, confirm an update carries the expected storage states.
Consent updates also push cookie_consent_update. Accepted categories can additionally push cookie_consent_marketing, cookie_consent_statistics, and cookie_consent_preferences.
If no consent command appears, confirm the published bundle has Consent Mode enabled and identify whether the page uses direct loading or the GTM template. Do not diagnose a template load from the direct-load settings.