Pixels overview
您可以使用Shopify像素经理管理your pixels that track customer events. The Shopify pixels manager allows you to manage and add pixels that track customer events. Customer events are actions that take place in the customer's browser, for example, clicking a link or adding a product to a cart. You can add and manage pixels in theCustomer eventssection of your Shopify admin.
Previously, merchants could manually add JavaScript snippets in several places in their online store: in online preferences, in checkout scripts, and in apps. These scripts weren't usually quality controlled, and were time-consuming to manage. With the pixel manager, your scripts are stored in a single management tool and run in asandbox environment. Adding app pixels or custom pixels to your store can provide the following benefits:
- Access to a stream of customer events on your online store, including checkout events
- An additional layer of security for your online store and your customers, including greater control over the customer data that you share with third-party services
- Prevention of third-party code running non-performing Javascript, or interfering with your online store and checkout
- Built in tools for privacy compliance
Pixels can be added to your online store in two ways: throughapp pixels, which are installed through marketing and data collection apps, andcustom pixels, which can be manually added by a developer in the pixels manager.
Sandbox environment for pixels
Shopify uses a secure sandbox for app pixels and custom pixels. A sandbox is an isolated environment that allows you to run scripts without affecting the rest of your online store. A sandboxed pixel has the freedom to run anywhere on your website, but is restricted to the data made available within the sandbox. This sandbox ensures that any pixels installed or created in the pixels manager can't collect or retrieve data outside the stated intent of the pixel, which could be a security risk.
Learn more about thepotential risks associated with pixels.
Pixels sandbox limitations
There are some limitations on what information can be accessed, because pixels run in a secure sandbox environment. The increased security gives you and your customers greater control over what data third parties have access to. These limitations might not be compatible with some third-party pixels. Consult the third-party pixel provider to confirm which pixels are compatible.
Review the following known limitations of the pixels sandboxes:
- Can't render user interface elements, such as buttons, forms, banners, or modals
- Automatic detection of events from DOM scraping
- Automatic detection of metadata from DOM scraping
- Automatic detection of user information, such as email and phone, from DOM scraping
- Automatic detection of outbound link clicks from DOM scraping
- Automatic detection of page scrolling
- Automatic detection of clicks and mouse movement to create heatmaps from DOM scraping
Automatic detection of page URLs in the Lax sandbox include a sandbox version and not exactly reflect the main window’s URL. You can get the main window’s URL from thepage_viewed
event.
For automatic detection of events, metadata, user information, and outbound links from DOM scraping, you can publish custom events as an alternative. Publishing custom events might not be supported by all app pixels.
Potential risks
Always ensure you understand the code that you add to your online store or store checkout, or hire aShopify Expertfor help with custom pixels.
Performance risks
Pixels are scripts that run in the background of your online store to track customer events. The more scripts you have, the slower your store will run. Additionally, if the script added is broken or formatted incorrectly, then the activity could run indefinitely, which can cause your site to load slowly or fail to load.
Privacy risks
用户隐私是ensur严格管制e customer information is protected online. Code snippets can be used to bypass customer consent requirements, which violates the Shopify Terms of Service and can lead to legal liability for you. This is especially true if you live in or serve customers in locations with stricter privacy regulations, such assome US statesor the European Economic Area. Remember that you are responsible for complying with applicable laws and getting all necessary consents when you use pixels to collect customer data. Speak with a lawyer if you are unsure about the requirements that apply to you.