DATALYR

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).

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.

See what really drives revenue.

Real-time attribution, analytics and conversions for every channel, campaign and ad, ready for your team and your agents.

Get started