Web pixel extension
Previously, pixels required merchants and Partners to modify an online store’s theme code, which was a difficult and error prone process. Often this code was broken, unmaintained or forgotten.
The aim of the Web Pixel Extension is to provide Partners with a simplified process for managing and processing behavioral data, by loading pixels in a secure sandbox environment with APIs for subscribing to customer events. With this aim Web Pixel Extensions are meant to provide the following benefits to merchants and Partners:
- Eliminate or minimize requiring merchants to add tracking code
- Securely access all surfaces, like storefront, checkout and post-purchase pages
- Control what data Partners have access to
- Compatible with our Customer Privacy API, for requiring consent as needed
- Avoid incidents with performance and privacy alerts
- Lighter pixel code libraries with the removal of excess DOM manipulation code
RequirementsAnchor link to section titled "Requirements"
Sandbox environmentAnchor link to section titled "Sandbox environment"
window.document will not work. Instead, we provide app developers a set of contextual APIs to replace their functionality.
The sandbox is designed so that merchants and buyers have complete control over what data is collected by Partners. These controls mean some common features of pixels won’t work the same or won’t work at all. Specifically, these include any features that rely on scraping the DOM for information or attempting to write to the DOM.
Although these limitations may seem constraining, most can be overcome by leveraging the data passed into the sandbox using the Web Pixel Extension API.
How web pixels worksAnchor link to section titled "How web pixels works"
Once you’ve created your Web Pixel Extension and configured it to a given merchant’s shop, your pixel is able to load on the shop’s online store. As a visitor browsers the online store they’ll trigger customer events, which will be published to a Shopify data layer or event bus. Your pixel can subscribe to the events on this data layer and then transform the event payloads into a format that conforms to the requirements of your pixel’s data collection endpoint.
Currently, only events published by Shopify can be subscribed to. If you have any needs for non-standard customer events this solution may not be for you at this time.