Google Consent Mode v2 allows Google tags (Analytics, Ads) to adjust their behavior based on whether a visitor has given or denied consent. The Cookiebot for Shopify app includes Consent Mode v2 support by default.
Using the Cookiebot for Shopify app (recommended)
If you are using the Cookiebot for Shopify app, Google Consent Mode v2 is automatically configured. No additional steps are required to enable the consent default state.
To connect specific Google services, navigate to Settings > Google Consent Mode inside the app and enter your relevant IDs.
Note
When using the app, the consent signals flow through Shopify's Customer Privacy API. You do not need to manually add a gtag consent default snippet in your theme — the app handles this.
Using Cookiebot via manual theme.liquid installation
If you have installed Cookiebot manually (without the app), you need to configure Consent Mode yourself:
- Add the Cookiebot script to your
theme.liquidfile inside the<head>tag, as the first script. - If using GTM, add the GTM container snippet to
theme.liquidbefore the Cookiebot script. - Do NOT place the GTM snippet inside a Shopify Custom Pixel — this breaks Consent Mode.
- In GTM, use the official Cookiebot Consent Mode tag template to fire consent updates.
- Enable the Shopify Customer Privacy API by adding the required API sync code.
The scanner says 'Google Consent Mode not installed' — is this a problem?
Not necessarily. The Cookiebot scanner detects Consent Mode by reading static page code. If you have connected GTM via Shopify Customer Events, the scanner cannot detect this type of setup and will show a warning even if Consent Mode is working correctly.
To verify your setup, run in your browser console:
window.Shopify && window.Shopify.customerPrivacy— should return an object, not undefined.window.Shopify.customerPrivacy.currentVisitorConsent()— after accepting, consent values should match what Cookiebot reports.
Important
GTM inside a Shopify Custom Pixel is not a supported setup. Custom Pixels are sandboxed and cannot share consent state with the main page. Use theme.liquid for GTM installation instead.
Why does consent default appear 'granted' before the visitor accepts?
If all consent signals are set to 'granted' before any user interaction, another script is likely setting consent before Cookiebot loads. Common causes:
- A hardcoded
gtag('consent', 'default', {...})snippet in your theme.liquid set to 'granted'. - A duplicate GTM container or GA snippet loaded outside of Cookiebot's control.
- Another consent platform running alongside Cookiebot (e.g., Finsweet, Shopify's native banner). Only one CMP should be active at a time.
Comments
0 comments
Please sign in to leave a comment.