- Shopify Pixels (the pixels manager under Settings › Customer events) is where every tracking script on a Shopify store now runs, including checkout.
- App pixels are installed by apps; custom pixels are code you or a developer paste in. Both run in a sandbox and receive the same standard events.
- Standard events such as product_viewed, product_added_to_cart, checkout_started and checkout_completed map neatly onto GA4 ecommerce events.
- App pixels now default to an "Optimized" data sharing setting that can pause data when Shopify sees little signal; set a pixel to "Always on" if it must receive every event.
- Pixels are still browser code: ad blockers and consent apply, so purchases should also go out server-side from the order.
Shopify customer events are the actions shoppers take on your store, such as viewing a product, adding to cart or completing checkout. Shopify publishes them to web pixels: small tracking scripts that you manage under Settings › Customer events in the Shopify admin, instead of pasting code into your theme or checkout. Every pixel, from Meta's to your analytics tool's, receives the same events and runs in a sandbox Shopify controls.
This guide explains what Shopify Pixels are, the difference between app and custom pixels, the standard events, an example custom pixel, how to map the events to GA4, and the data sharing setting Shopify added for app pixels.
What is "Shopify Pixels"?
A pixel is a piece of code, almost always JavaScript, that passes what shoppers do on your store to another service for marketing or reporting: the Meta Pixel, the GA4 tag, the TikTok Pixel, an affiliate network's tag. For years those scripts lived in theme files and in the checkout's Additional scripts box. Nobody could see in one place which scripts were installed, what data they took or whether they still worked.
Shopify Pixels changes that. Pixels are added in one place in the admin, Shopify sends them the events, and you can see, pause or remove each one. For a store owner the benefits are:
- Events without custom code. Shopify publishes product views, cart changes, checkout steps and purchases itself, so a pixel only has to listen.
- One overview. Every pixel on the store, with who added it and whether it is connected.
- Consent in one place. Each pixel declares which permissions it needs (marketing, analytics, sale of data), and Shopify only runs it when the visitor's choice allows it.
- No code in theme files. Apps no longer inject scripts into the theme, so a theme update cannot break tracking and an uninstalled app leaves nothing behind.
- Custom events when you need them. A developer can publish extra events from the theme for things Shopify does not track by default.
App pixels and custom pixels
- Installed by an app, with no copy and paste
- Run in a strict sandbox: they cannot read the page or load other scripts
- Show under the App pixels tab
- Have a data sharing setting (Optimized or Always on)
- Code you or a developer paste in under Add custom pixel
- Run in a looser sandbox (an iframe) that can load third-party scripts
- Show under the Custom pixels tab
- Run as written, without Shopify's optimization
Neither kind can read the page around it. A pixel cannot see the landing URL of the checkout window or the cookies of the storefront the way a theme script could. That is the trade-off for safety: tracking that depends on the original page has to collect what it needs earlier, on the storefront, and carry it along.
The standard customer events
Shopify publishes a fixed set of standard events. These are the ones tracking setups use most:
| Customer event | When it fires |
|---|---|
page_viewed | Any page loads, storefront or checkout |
product_viewed | A product page is viewed |
collection_viewed | A collection page is viewed |
search_submitted | A search is made |
product_added_to_cart | A product is added to the cart |
cart_viewed | The cart page is viewed |
checkout_started | Checkout begins |
checkout_contact_info_submitted | The shopper enters contact details |
checkout_shipping_info_submitted | A shipping method is chosen |
payment_info_submitted | Payment details are submitted |
checkout_completed | The order is placed (thank-you page) |
How to add a custom pixel
- Open Customer events
In the Shopify admin go to Settings › Customer events and click Add custom pixel. Give it a clear name, such as the service it sends to.
- Set the permissions
Choose whether the pixel needs marketing or analytics permission, and whether its data counts as a sale of data. Shopify then only runs it for visitors whose choice allows it.
- Paste the code
The code subscribes to the events it needs with analytics.subscribe and sends them on.
- Save and connect
Click Save, then Connect. Until it is connected, the pixel does not run.
- Test it
Place a test order and check that the event arrives at its destination. Tools that look inside the page, such as browser extensions for a pixel, may not see code that runs in the sandbox.
Code example: a simple custom pixel
This example listens for checkout_completed and posts the purchase to an endpoint of your own. It is a sketch to show the structure, not a ready-made integration:
// Settings › Customer events › Add custom pixel (example: log the purchase to your own endpoint)
analytics.subscribe('checkout_completed', (event) => {
const checkout = event.data.checkout;
fetch('https://collect.example-shop.com/purchase', {
method: 'POST',
keepalive: true,
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
event_id: event.id,
order_id: checkout.order && checkout.order.id,
value: checkout.totalPrice && checkout.totalPrice.amount,
currency: checkout.currencyCode,
}),
});
});Three things to notice. The pixel only subscribes, it never scrapes the page. Each event has its own id, which you can reuse as the event id so a server-side copy of the purchase is not counted twice. And keepalive lets the request finish even when the shopper closes the tab right after checkout.
Mapping customer events to GA4
If you set up GA4 through a custom pixel, translate each Shopify event into the matching GA4 ecommerce event:
| Shopify customer event | GA4 event | Main parameters |
|---|---|---|
page_viewed | page_view | page location, title |
product_viewed | view_item | items, value, currency |
collection_viewed | view_item_list | items, list name |
search_submitted | search | search_term |
product_added_to_cart | add_to_cart | items, value, currency |
checkout_started | begin_checkout | items, value, coupon |
checkout_shipping_info_submitted | add_shipping_info | shipping tier |
payment_info_submitted | add_payment_info | payment type |
checkout_completed | purchase | transaction_id, value, tax, shipping, items |
The "Optimized" data sharing setting for app pixels
In early 2026 Shopify changed the default data sharing setting for app pixels from Always on to Optimized. Custom pixels are not affected. In Optimized mode, Shopify watches whether a pixel's data seems to be used for traffic or sales attribution, and it can limit or pause the events it shares with that pixel when it sees little signal. The aim is to stop forgotten apps from collecting data nobody uses.
The side effect: an app pixel that forwards events to its own server, which then sends them on to Meta or Google, can look idle to Shopify, because Shopify cannot see that forwarding. Shopify does not notify you when it pauses a pixel; you notice it as fewer events in the destination.
- Open the app pixels
Go to Settings › Customer events and select the App pixels tab.
- Check the Data column
Each app pixel shows its data sharing setting.
- Switch to Always on where it matters
Click the value and choose Always on for pixels you rely on for tracking and attribution. Leave unused pixels on Optimized, or remove the app.
Server-side delivery from the order, such as Meta's Conversions API fed by an order webhook, does not go through a pixel and is not affected by this setting.
Pixels are still browser code
Customer events make tracking tidier, but a pixel still runs in the shopper's browser. Ad blockers can stop its requests, a visitor who declines consent will not trigger it, and a shopper who pays on an external page and never returns may not fire checkout_completed at all. That is why a sound setup also sends the purchase from the paid order on the server, with the same event id as the pixel. Server-side tracking for Shopify explains how the two fit together.
How ROASaurus uses customer events
When you install the ROASaurus Shopify app, it creates its app pixel for you. The pixel declares that it needs marketing permission and follows the visitor's choice during checkout. The optional custom pixel, which you add under Settings › Customer events with a snippet from Connections › Tracking & destinations, adds browser pixels in checkout. Because the ROASaurus app pixel forwards events to ROASaurus rather than straight to an ad platform, set it to Always on in the App pixels tab. Purchases themselves go out from the paid order, so they still reach the ad platforms if a pixel is paused. Each delivery and its response are listed in Data quality › Deliveries.
Next step
Sources
- Shopify Help Center: Pixels overview
- Shopify Help Center: App pixels
- Shopify Help Center: Manage your custom pixels
- Shopify Changelog: New default setting for pixel data sharing
- Shopify developers: Web pixels standard events
- Google Analytics: Measure ecommerce (GA4 events)
In ROASaurus
- Help: set up ROASaurus on Shopify
- Shopify integration
- Server-side tracking in ROASaurus
- Free tracking audit