Skip to main content

Pixel Privacy

In order to comply with international privacy regulations, Shopify provides a way for merchants to manage their pixels and the data they collect. This guide will help you understand how to set up customer privacy settings for App and Custom pixels, and how to use the customerPrivacy API to manually handle pixel privacy behavior.


Anchor to App Pixels Privacy SettingsApp Pixels Privacy Settings

When creating app pixels, you can define the customer privacy settings that your pixel requires within your shopify.extension.toml file. Shopify's pixel manager will only load your pixel if there is visitor permission for all of the settings that your pixels declares as required. For more information, visit the App Pixel Tutorial documentation.


Anchor to Custom Pixels Privacy SettingsCustom Pixels Privacy Settings

When creating custom pixels, you can define the customer privacy settings that your pixel requires directly within the user interface. For more information please visit the Custom Pixel documentation.


Anchor to Customer Privacy APICustomer Privacy API

Shopify provides Standard APIs to allow pixels to query the initial customer privacy permissions on a page and listen to any subsequent updates to consent. To query the initial customer privacy permissions, use the init.customerPrivacy API. You may assign this value to a variable to keep track of it throughout the lifecycle of your pixel. If consent changes without a page refresh (i.e. customer provides consent through a banner), you can adjust this value using the customerPrivacy Standard API. This API allows you to subscribe to the visitorConsentCollected event and apply any changes when consent is given. Using these APIs, you can manually handle any privacy related behavior inside a pixel sandbox.

Available Customer Privacy Events

Presently, the only event available for the customerPrivacy.subscribe() API is visitorConsentCollected. This is the only string that will be accepted for now.


Was this page helpful?