Shopify Customer Privacy API and consent mode tracking
How Shopify's Customer Privacy API decides which pixels run, how Google Consent Mode v2 fits in, and what consent means for ad attribution on your store.
By DATALYR · · 3 min read
Contents
What the Customer Privacy API controls
Shopify's Customer Privacy API records each visitor's consent and applies it to Shopify-managed surfaces, including pixels and checkout. Tracking tools ask it whether analytics, marketing, preferences or the sale of data are allowed before they collect anything.
It combines three inputs: your store's privacy settings, the visitor's location and the visitor's choices. In regions you configure to require consent, non-essential processing is off until the visitor opts in. Elsewhere, processing is allowed by default.
The four consent categories
The API exposes one check per category: preferencesProcessingAllowed, analyticsProcessingAllowed, marketingAllowed and saleOfDataAllowed. Each returns true or false after combining settings, location and choice. A visitorConsentCollected event fires when the visitor changes their choice.
Sale of data is handled separately from opt-in consent. In regions where you show a data sharing opt-out, usually US states, Shopify honours a Global Privacy Control signal automatically and records the sale of data as declined.
- Analytics: measurement of how visitors use the store.
- Marketing: ads and marketing based on interests, including ad pixels.
- Preferences: remembered settings such as language or country.
- Sale of data: sharing with third parties, usually for behavioural advertising.
How consent changes pixel behaviour
Shopify pixels run only when the visitor has granted the permissions the pixel configuration requires. New pixels require marketing and analytics permission by default, and pixels marked as data sales do not run for visitors who opted out of data sale.
If you use a third-party banner, connect it to Shopify's customer privacy settings and make its regions match Shopify's. Shopify warns that mismatched regions can process data before the visitor consents. Pixels or cookies added outside Shopify's pixel system may need their own consent logic.
Illustrative example. A store gets 10,000 sessions from consent regions and 6,500 accept marketing, a 65% rate. Ad pixels run for those 6,500 only. If 200 orders come from those regions and buyers accept at the same rate, about 130 carry browser identifiers and about 70 do not (200 × 0.65 = 130).
Where Google Consent Mode v2 fits
Google Consent Mode passes four signals to Google tags: ad_storage, analytics_storage, ad_user_data and ad_personalization. ad_user_data controls whether user data such as enhanced conversion details can be sent to Google for advertising.
Shopify says event data from visitors in regions such as the EEA will not be used for personalised advertising unless Consent Mode v2 is active and valid consent was obtained. Your customer privacy settings must be configured so consent reaches Google. If you load Google tags through a custom pixel, Shopify says to add a code snippet that activates Consent Mode v2 yourself.
Google describes two modes. Basic mode blocks Google tags until the visitor answers the banner. Advanced mode loads tags with consent denied by default, sends cookieless pings, and lets Google model conversions from those pings once a data threshold is met.
What consent means for attribution
Orders do not depend on consent. Shopify still records every paid order. What changes is how many orders can be linked to an ad click, because the browser identifiers that make that link exist only when tracking was allowed.
Report the unlinked share openly rather than spreading it across campaigns. A campaign with 100 linked orders in a market where 35% of buyers decline consent is not a campaign with 100 total orders. Comparing campaigns within the same market keeps that bias even.
Do not change consent settings to make attribution look better. Consent rates are a legal and customer-trust decision. Measurement should report honestly within them.
How DATALYR handles Shopify consent
DATALYR's web SDK reads Shopify's Customer Privacy API directly. On a Shopify store it waits until the API allows tracking, and a visitor who declines is never tracked. It also honours Global Privacy Control by default.
When marketing consent is denied, DATALYR stops writing the visitor ID and Meta click IDs into the cart. The order still arrives from Shopify with its revenue, but with no visitor link no campaign earns credit. Any conversion carrying a marketing denial is sent to ad platforms with no user-level identifiers, and Google receives the denial in its consent fields.
Related articles.
Commerce ·
Shopify conversion tracking: reconcile orders, refunds and ad delivery
Verify Shopify order capture, campaign identity, transaction revenue and destination delivery without counting the same purchase more than once.
Google Ads ·
Enhanced conversions: web and lead workflows, current settings and verification
Understand the different business workflows behind enhanced conversions, Google’s unified settings, and the evidence needed to verify a setup.
Tracking ·
First-party data: build an inspectable marketing measurement record
Inventory the data your business collects directly, separate measurement from advertising sharing, and verify each field’s purpose and destination.
