Skip to main content
Back to Guides
Compliance7 min readBy Armin Zaribaf

Shopify Cookie Banner for CCPA/CPRA: 2026 Setup

California requires Shopify stores to offer a working Do Not Sell or Share opt-out, handle GPC, and relay the sale-of-data signal to Shopify itself. Here is the full setup.

California's privacy law doesn't ask for an opt-in cookie banner. What it does require is a working opt-out of the sale and sharing of personal information, an opt-out mechanism that actually stops the tags responsible for selling and sharing, and automatic recognition of the Global Privacy Control signal. Under the CPRA amendments, "sharing" covers disclosing data for cross-context behavioral advertising even when no money changes hands, which describes what most advertising pixels do.

A Shopify opt-out serves two purposes. It stops the advertising pixels you added to the theme, and it tells Shopify's platform, because Shopify analytics and apps that read the Customer Privacy API base their data-sharing decisions on the consent state reported there, including a dedicated sale_of_data flag.

Requirements under CCPA/CPRA
RequirementWhat the law expects
Opt-out linkEvery page needs a "Do Not Sell or Share My Personal Information" link, or the alternative "Your Privacy Choices" link
Opt-out preference signalsHonor Global Privacy Control as a valid opt-out of sale and sharing, without requiring any additional click from the visitor
Sensitive dataProvide a "Limit the Use of My Sensitive Personal Information" link when you process sensitive data beyond the permitted purposes
MinorsObtain opt-in consent before selling or sharing the data of consumers you know to be under 16
Re-askingAllow at least 12 months before asking a consumer who opted out to reconsider

How CookieBeam's CCPA/CPRA preset handles it

CookieBeam provides a regional preset designed for California visitors. Applying it generates an editable rule that ships with the following starting values.

What the CCPA/CPRA preset sets
SettingCookieBeam preset
Who it matchesVisitors in California
Banner modeOpt-out: tags run from the first page view until the visitor opts out
Buttons"Accept Cookies" and "Reject All" on the first layer, plus "Do Not Sell or Share My Personal Information", which opens the US opt-out panel
Persistent opt-out linkOff when the rule is created; turn on the rule's Do-Not-Sell link option to keep "Do Not Sell or Share My Personal Information" available after the first choice
Google Consent Mode defaultsAll storage types start granted until the visitor opts out
Global Privacy ControlHonored automatically as an opt-out, with no click needed; it cannot be switched off for visitors this preset matches
Stored choiceExpires after 365 days, then the visitor is asked again

Where Shopify sites leak data

  • Shopify's own tracking. Shopify analytics and apps that check consent via the Customer Privacy API only learn a visitor's choice when something passes it along. CookieBeam's Shopify bridge calls setTrackingConsent whenever the API is available on the page, sending analytics, marketing, preferences and sale_of_data. The app embed also loads the API so it is available earlier.
  • Pixels added in theme code or by apps. A tracking pixel dropped straight into theme.liquid runs at page render unless you mark it as inert so CookieBeam can activate it later. Pixels that come from installed apps need individual verification.
  • Checkout. Theme code and theme app embeds don't run on checkout pages, which means the banner won't show there. The choice the shopper made on the storefront is stored by the Customer Privacy API and carries through to checkout.

Shopify's sale-of-data flag

CookieBeam's Shopify bridge writes sale_of_data from the ad-user-data signal, so a California shopper who opts out is reported to Shopify whether you install through the app embed or through theme code. The app embed loads the Customer Privacy API early, giving Shopify the signal before any first-party tag fires. Verify with currentVisitorConsent() after opting out.

Set up CookieBeam on Shopify for CCPA/CPRA

1

Publish your banner first

Build the banner in CookieBeam, set up its consent categories, and publish it to production so the loader script has a live configuration to serve. See the quickstart.

2

Add the store's domains to the banner

In CookieBeam, add both the *.myshopify.com domain and any custom domain to the banner.

3

Load the banner on every storefront page

Using the CookieBeam app: navigate to Online Store › Themes › Customize › App embeds, enable CookieBeam consent banner, enter the banner ID and save. The app isn't in the Shopify App Store yet. Without it, paste the production loader as the first script in <head> of layout/theme.liquid. Do not add async or defer.

4

Turn off Shopify's own cookie banner

In Shopify admin, go to Settings › Customer privacy and disable the built-in banner so visitors see a single prompt instead of two competing ones.

5

Apply the CCPA/CPRA preset

On the banner's Regional settings page, add a rule from the CCPA/CPRA framework preset. It matches visitors in California with an opt-out banner: tags run from the first page view until the visitor opts out. Its preferences button reads "Do Not Sell or Share My Personal Information" and opens the US opt-out panel. Turn on the rule's Do-Not-Sell link option so a persistent link stays available after the first choice. Add the US Opt-Out States preset too if you serve other states. See regional rules.

6

Mark the tags that sell or share

Advertising pixels and data-sharing tags belong in the marketing category. Scripts that appear in your reviewed scan inventory are managed by CookieBeam once you turn on blocking; scripts hard-coded in the page need inert markup (type="text/plain" with a data-category attribute) so CookieBeam can control them. See script blocking. In opt-out mode these tags run by default and are deactivated once the visitor opts out.

7

Save, publish and test

Click Save Settings, then Publish in the banner header. Changes to rules only take effect for visitors after you publish. Full install instructions: Shopify install docs.

layout/theme.liquid
<!-- layout/theme.liquid: first script in <head> -->
<script
  id="CookieBeam"
  src="https://cdn.cookiebeam.com/banner/PUBLIC_BANNER_ID/default/loader.js"
  type="text/javascript"
  data-cfasync="false" data-no-optimize="1" data-no-defer="1"
  data-no-minify="1" data-noptimize="1" nowprocket data-pagespeed-no-defer
></script>

Test your Shopify store like a California visitor

  1. Open the site in a fresh browser profile, from California or with a geo-simulated preview, and confirm the opt-out banner appears.
  2. Select the opt-out for sale and sharing, reload the page, and check the Network tab: advertising pixels should no longer be loading.
  3. In a GPC-enabled browser, confirm navigator.globalPrivacyControl is true, load the site fresh, and verify that advertising tags never fire without any click.
  4. Confirm the Do-Not-Sell link remains reachable after the visitor has made their first choice.
  5. Run window.Shopify.customerPrivacy.currentVisitorConsent() in the browser console after each consent choice and confirm that the returned flags match what you selected.

The cookie banner QA checklist walks through additional checks.

Frequently Asked Questions

Does the opt-out carry over to Shopify checkout?

The banner doesn't appear at checkout, but the storefront choice is stored by Shopify's Customer Privacy API and carries through automatically.

Does a Shopify store need a Do Not Sell link if it doesn't sell data?

Most ad pixels qualify as "sharing" under the CPRA because they disclose data for cross-context behavioral advertising. If your store runs them and the CCPA applies to you, the opt-out is required.

Can I keep Shopify's built-in cookie banner alongside CookieBeam?

Turn it off. Two banners means two prompts that can return conflicting answers. CookieBeam relays the choice to Shopify through the Customer Privacy API, so Shopify's own tracking still follows the visitor's decision.

Does the banner appear at checkout?

No. Theme code doesn't run on Shopify's checkout pages. The choice the shopper made on the storefront is stored by Shopify's Customer Privacy API and carries through to checkout automatically.

Does a site need an opt-in cookie banner for CCPA?

No. A covered business needs a working Do Not Sell or Share opt-out, GPC handling, and an opt-out that actually stops the selling and sharing tags. A banner paired with a persistent link is the standard way to deliver that.

For Shopify: Shopify's Customer Privacy API. For the law: how to build a compliant Do Not Sell or Share link, Global Privacy Control explained, CPRA enforcement in 2025-2026. Other platforms: US privacy law setup by platform.

Primary sources: California Attorney General CCPA page, California Privacy Protection Agency (regulations and enforcement decisions), Global Privacy Control specification.

This page summarises the law as we understand it in October 2026 for website and cookie decisions. It is not legal advice. Statutes, regulations and regulator guidance change, so check the current text with counsel before relying on any threshold or date mentioned here. CookieBeam's regional presets are configurable starting points, not a legal determination for your site.

7 min read

GPP, MSPA & US State Signals: A Publisher's Guide

The US Privacy String you built for CCPA was deprecated in January 2024. GPP, the US National string, and the MSPA replaced it, and getting the signal wrong can be a misrepresentation. Here's how the new US privacy signals move through the ad stack.

5 min read

Building a TCF CMP That Passes IAB Validation

What it takes for a Consent Management Platform to pass IAB Europe's TCF checks: a registered CMP ID, a cleanly decodable TC String, event-listener delivery, and encoding against the right GVL version.

9 min read

How to Migrate Your CMP Without Losing Existing Consent Records

A step-by-step technical guide to switching consent management platforms without losing consent records, triggering mass re-consent, or breaking Consent Mode. Covers export, category mapping, parallel runs, and zero-downtime migration patterns.