Guides
Google Consent Mode v2
ConsentLayer automatically manages Google Consent Mode v2 — no additional setup required.
How it works
- On page load, the banner sets all consent signals to
denied(exceptsecurity_storage) - When consent is given, the banner updates the consent signals to match the user's choices
- Google tags read these signals and adjust their behavior accordingly
Signal mapping
| ConsentLayer Category | Google Consent Signals |
|---|---|
essential | functionality_storage, security_storage |
statistics | analytics_storage |
marketing | ad_storage, ad_user_data, ad_personalization |
Verification
Open your browser's developer console and check:
// After consent is given
dataLayer.push({event: 'consent_check'})You should see the consent signals update in the Google Tag Assistant.
Excluding Google from script blocking
By default, ConsentLayer excludes Google's own scripts from blocking when Consent Mode is active (since Consent Mode handles the compliance). This is controlled by the gcmExcludeGoogle setting in your banner configuration.