Article
Shopify Customer Privacy API does not block scripts
Shopify's Customer Privacy API records and exposes consent for themes and apps. Theme scripts, app embeds, and pixels still load unless their own code waits. Here is how to test that on a storefront.
In brief
Shopify's Customer Privacy API lets themes and apps read whether a visitor allowed marketing, analytics, preferences, or the sale of data. The API records that consent and exposes it. Theme scripts, app embeds, and pixels still load unless their own code reads the state and waits. This page covers that API limit. The Shopify pixel testing guide and the pre-consent audit checklist cover the full storefront pass.
Not legal advice
This article describes how Shopify's Customer Privacy API behaves as a consent recording and signaling surface for themes and apps. It is not legal advice, not a Shopify support document, and not a guarantee that any configuration meets GDPR, CPRA, or other rules. Confirm Shopify's current docs before you ship a change. Admin labels and API names move. Last updated September 22, 2026.
Short answer
Shopify's Customer Privacy API lets themes and apps read whether a visitor has given consent for categories such as marketing and analytics. It records that choice and exposes it. It does not, by itself, stop every script, pixel, or theme app embed from loading. If an app injects a tracker on page load without reading the API, or reads the API after the request already left, cookies and requests can still fire before Accept.
This page covers that API limit. The Shopify pixel testing guide and the pre-consent audit checklist cover the full storefront pass: banner, embeds, reject hold, and the evidence table. Load the shop in a clean browser, leave the banner alone, and inspect the network and cookies. Then walk Reject All and Accept All in separate profiles.
The expectation merchants start with
Merchants turn on Shopify cookie consent or the Customer Privacy settings and expect every theme script, app, and pixel to wait. The API is the consent-state interface those surfaces can read. A block happens when theme code, pixels, and apps consult that state and gate their own loads.
Shopify's Customer Privacy API docs, checked September 22, 2026, say the API applies consent decisions to Shopify-managed surfaces such as pixels, audiences, and checkout. App pixels and custom pixels can declare the purposes they require. The pixel manager then loads those pixels when the visitor has granted each required purpose. That path covers pixels registered with Shopify. Theme Liquid, theme JavaScript, theme app embeds, and apps that inject their own script tags still need their own check.
What the API does
The API collects and stores the visitor's consent preferences. Merchants configure region-aware privacy settings in the admin. Theme JavaScript and participating apps can read the result after the storefront loads the consent-tracking API.
Current storefront calls, as documented on September 22, 2026, sit on window.Shopify.customerPrivacy after Shopify.loadFeatures loads consent-tracking-api. The documented reads include marketingAllowed, analyticsProcessingAllowed, preferencesProcessingAllowed, saleOfDataAllowed, and currentVisitorConsent. A visitorConsentCollected event fires when consent changes. setTrackingConsent records a choice the visitor made. Re-read Shopify's Customer Privacy API page before you copy a call into a theme. Names change.
Those docs also say Shopify collects the GPC signal for data-sale opt-out in regions configured for that opt-out, and that setTrackingConsent cannot override that collection. That line is about Shopify's consent record. Confirm the live page, then prove theme embeds with the network log. A Shopify privacy banner writes the same consent state. Other loaders see the choice only if their code asks.
What still loads
A marketingAllowed value of false is the API state at the moment you read it. Scripts that never call the API, or that fire before the read, still send requests. Read the runtime audit versus CMP guide when banner copy and the wire disagree. The rows below are places to look. They are not a verdict on any vendor.
| Source | What to check |
|---|---|
| Theme app embeds | They inject early unless the embed's own code waits for the consent state |
| App pixels and customer events | They wait when the pixel declares required purposes and the pixel manager enforces that wait. A purpose that does not match the tag, or a loader outside the pixel sandbox, still fires |
| Hard-coded theme scripts | Theme Liquid or JavaScript that never calls the Customer Privacy API |
| Chat, reviews, and upsell apps | Their own loaders can ignore the consent state and request on page load |
| A third-party banner plus Shopify settings | The two UIs can overlap or race. The banner looks settled while a pixel request already left |
Test the live storefront
Test the public hostname customers open. An admin preview can miss the theme and the apps that the live theme loads. Keep each consent action in its own clean profile.
- Open a clean browser profile. Load the homepage and one product URL. Do not click the banner.
- In DevTools, list cookies and the Network log. Mark marketing or analytics requests that appear before any Accept click.
- Optional: after the Customer Privacy API has loaded, read marketingAllowed, analyticsProcessingAllowed, and currentVisitorConsent in the console. Use the method names from Shopify's current docs. Write the values next to the request list. A false read is the API state. The request list shows whether tags waited.
- Click Reject All, or the equivalent control. Treat the click as done only when the banner state or a preference value changes. Navigate once. Check whether marketing requests stay quiet on the next page.
- Open another clean profile. Accept All. Record the vendors that appear. This visit is the baseline for an accepted load. If the reject visit matches it, reject did not change the wire.
- Package the files and send them to the theme or app developer. For the full banner, embed, and reject-hold table, use the pre-consent audit checklist and the Shopify pixel testing guide.
Evidence pack
Label screenshots fresh, reject, or accept. Include the cookie table, the request URLs, which apps or embeds you suspect, timestamps, and the theme name if you know it. ConsentProbe ties findings to the request, the cookie, and the screenshot. A banner screenshot alone does not show whether a pixel fired before Accept.
DIY compared with a saved audit
Two URLs in DevTools can show a tag that loads before Accept. A saved audit stores the same scenarios with linked evidence.
| Check | DIY DevTools | ConsentProbe |
|---|---|---|
| Speed | About 15 to 20 minutes for two URLs | Paste the storefront URL and run labeled scenarios |
| Blind spots | Easy to miss an app embed in the waterfall | Systematic request and cookie capture |
| Handoff | You zip the screenshots | Findings linked to evidence |
| Region | You choose the network path and locale | Free US-baseline, or paid EU and California when the region matters |
Share a labeled storefront pack
Run ConsentProbe on the public storefront URL and send the evidence pack to your developer or agency, next to the pre-consent audit checklist. A free US-baseline visit does not produce an EU or California conclusion. This page is not legal advice.
FAQ
Does the Customer Privacy API block scripts?
No. It records consent and exposes that state. A script waits only when the theme, the pixel, or the app gates its load on that state. Shopify-managed pixels can wait when their privacy settings require a purpose the visitor has not granted.
I enabled Shopify's cookie banner. Why do pixels still fire?
Something is loading without waiting for consent. Check theme app embeds, app pixels, hard-coded theme scripts, and chat or review apps on the live storefront, before you click Accept.
Is a CMP app enough?
Only when the runtime matches the banner. Read the runtime audit versus CMP guide and walk the pre-consent audit checklist. A banner that says tags wait is not the network log.
Where is the full Shopify checklist?
Use Testing Shopify Pixels Before Consent for pixels and theme checks, and the pre-consent audit checklist for the fresh, storage, reject, accept, and evidence passes.
Does a free US scan prove GDPR for EU shoppers?
No. A free US-baseline visit is one non-California pass. EU fresh, reject, and accept conclusions need the EU scenarios. Read the free versus paid guide.
Is this official Shopify documentation?
No. Verify behavior against Shopify's current Customer Privacy API and pixel privacy docs. Admin labels and method names change. This page is not legal advice.
Related guides
The Shopify pixel testing guide and the pre-consent audit checklist are the full pass. The reject leftovers page covers the reject click. The free versus paid guide says what a US-baseline file can support.
- Testing Shopify Pixels Before Consent
- Pre-consent audit checklist: what to verify before Accept
- Pre-Consent Cookie Audit: A Storefront Checklist
- Reject All Still Tracking: What to Check After You Say No
- What does a free US-baseline cookie audit prove vs paid EU or California scans?
- Runtime Audit vs CMP: What Each One Measures
- ConsentProbe methodology
- Pricing and listed regional products
Sources
These links cover the platform and regulatory context used in this guide. Applicability still depends on the organization and jurisdiction.
Save a US-baseline technical record
After a DIY check, run a free US-baseline audit: one browser visit outside California, with cookies, requests, and screenshots stored as evidence. That visit does not run EU reject/accept or California GPC. EU, California, and Global 2 audits can be purchased from Billing after sign-in.