Access Customer Privacy API during checkout

Topic summary

A developer is implementing Shopify’s cookie consent banner app and has successfully integrated the Customer Privacy API on the storefront to control tracking pixels based on user consent.

Current Challenge:

  • Need to verify user consent status on the order confirmation page
  • The standard Shopify.loadFeatures() method doesn’t exist on checkout/confirmation pages
  • Cannot access the consent tracking API using typical storefront methods

Proposed Solution:
Another user suggests accessing consent data through the customerPrivacy web pixel object, which appears to be globally available. This object contains boolean flags for different consent categories:

  • analyticsProcessingAllowed
  • preferencesProcessingAllowed
  • marketingAllowed
  • saleOfDataAllowed

Status: The discussion remains open, awaiting confirmation whether this web pixel approach works on order confirmation pages.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

We’re using Shopify’s own cookie consent banner app, and have successfully hooked in to the Customer Privacy API on the storefront to stop tracking pixels from firing unless the user has given consent via the banner. We need to do the same on the order confirmation page, but Shopify.loadFeatures() doesn’t exist so we can’t load the consent tracking api to query whether the user has granted consent.

How can we verify (either via JS or liquid) on the order confirmation page that the user has accepted tracking cookies?

2 Likes

It looks like you can access this via the globally available api.init.customerPrivacy web pixel object.

{
    analyticsProcessingAllowed: true,
    marketingAllowed: true,
    preferencesProcessingAllowed: true,
    saleOfDataAllowed: true
}