Install on Shopify
Add the CookieBeam banner to a Shopify store through the theme code today, connect it to Shopify's Customer Privacy API, and turn off Shopify's own banner.
Ultimo aggiornamento:
The CookieBeam Shopify app is not listed in the Shopify App Store yet. Today you add the banner by pasting the loader into your theme. Once the app is available, its app embed is the no-code route; see Shopify Customer Privacy. Shopify places the embed first among app embeds but doesn't promise it runs before {{ content_for_header }}, so the theme edit below stays the way to load the banner before everything else.
1. Add your store's domains
In CookieBeam, open the banner and go to Banner domains. Add:
- your
*.myshopify.comdomain, and - every custom domain the store uses.
The banner does not load on a hostname that is not listed.
2. Publish the banner
Select Publish and publish to production. Then open Deployment → Install and copy the direct installation code.
California visitors and Global Privacy Control
California's regulations require that an opt-out method address the sale and sharing of personal information. When a visitor sends a Global Privacy Control (GPC) signal, CookieBeam honors it as soon as the banner loads. The theme code route below places the loader first in <head>, so the GPC check runs before other scripts. If you use the app embed instead, Shopify places it after {{ content_for_header }}, so scripts in the header can run before the GPC signal is processed. For California compliance, the theme code route is the stronger setup.
3. Add the loader to your theme
- In Shopify admin, go to Online Store → Themes.
- On your current theme, open the ⋯ menu and choose Edit code.
- Open
layout/theme.liquid. - Paste the loader directly after the opening
<head>tag, above{{ content_for_header }}and above any analytics or advertising script. - Do not add
asyncordefer. Save.
<head>
<script src="https://cdn.cookiebeam.com/banner/PUBLIC_BANNER_ID/default/loader.js" data-cfasync="false" data-no-optimize="1" data-no-defer="1" data-no-minify="1" data-noptimize="1" nowprocket="1" data-pagespeed-no-defer="1"></script>
<!-- the rest of your theme's head, including {{ content_for_header }} -->
Edits to theme code stay with that theme. If you switch or replace the theme, add the loader again.
4. Turn off Shopify's own banner
In Shopify admin, open Settings → Customer privacy and turn off Shopify's cookie banner, so visitors see one prompt, not two.
5. Pass the choice to Shopify
Shopify's own analytics, and apps that read consent through Shopify's Customer Privacy API, only follow the visitor's choice if something passes it on. The banner's Shopify bridge does this. It is on by default under Vendor Consent Signals on the banner's App Integrations page.
The bridge only works when Shopify's Customer Privacy API is already on the page when the visitor's consent is resolved. If it is not there, the choice is not passed on. After installing, check it in the browser console on your storefront:
window.Shopify.customerPrivacy.currentVisitorConsent()
Make a choice in the banner and run it again. The flags should match what you chose. If window.Shopify.customerPrivacy is undefined, the API is not loaded on your storefront and Shopify's own tracking does not receive the choice. The CookieBeam app loads the API itself, which is why it is the better route once it is available. See Shopify Customer Privacy for how the flags are mapped.
What is not covered
- Checkout. Theme code does not run on Shopify's checkout pages, so the banner does not appear there.
- Pixels added by apps or in Shopify's customer events. These load outside your theme. Check each one in a scan and in Shopify's settings.
Check it works
Use a private window on the live storefront, not the theme editor preview, and follow Verify your installation.
App embed ordering
The CookieBeam app embed targets the compliance_head block, which Shopify renders inside <head> but after content_for_header. Theme scripts that load before content_for_header can run before it.
For stricter ordering, go to Online Store > Themes > Edit code and open layout/theme.liquid. Paste the loader as the first line after <head>, before the required content_for_header tag. Keep only one loader installation per page: the theme route replaces the app embed, not an addition to it. Do not remove the content_for_header tag. This route does not apply to the checkout.
Disconnect optional customer event pixels unless you have verified that the Shopify Customer Privacy API state propagates correctly to them. Do not remove the native Shopify consent banner until you have confirmed that tracking protection is working.
Sources: Shopify embed configuration. Verify: Installation checks.