Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Customer Privacy API

Requires access to protected customer data. The region property requires level 1 access. The applyTrackingConsentChange property requires the collect_buyer_consent capability.

The Customer Privacy API provides the buyer's current privacy consent settings, including consent flags, allowed processing activities, and region information. Use it to check consent status or determine whether to display a consent banner on the Order status page.

  • Display a consent banner: Determine whether to show a cookie consent banner when the page loads.
  • Read current consent state: Check the buyer's current preferences for analytics, marketing, and data sharing.
  • Apply consent changes: Save the buyer's updated consent preferences after they interact with your consent UI.
  • Handle regional requirements: Detect if the buyer is in a jurisdiction requiring specific opt-out controls, such as CCPA in California.
Support
Targets (25)

The Customer Privacy API object provides the buyer's privacy consent settings. Access the following properties on the API object to read privacy data.

Anchor to applyTrackingConsentChange
applyTrackingConsentChange
required

Applies changes to the buyer's tracking consent preferences and consent metafields.

Note

Requires the collect_buyer_consent capability to be set to true.

Requires access to protected customer data.

Anchor to customerPrivacy
customerPrivacy
StatefulRemoteSubscribable<>
required

The buyer's current privacy consent settings, including consent flags, allowed processing activities, and region information.


  • Check shouldShowBanner before displaying a consent banner: The shouldShowBanner flag accounts for the buyer's current consent, the shop's region configuration, and the buyer's location.
  • Use allowedProcessing for data decisions: Check the allowedProcessing flags before collecting analytics, marketing, or preference data.


Was this page helpful?