The Shopify Web Pixel API is the technology behind Shopify’s Customer Events system. It is the approved way to run tracking code during checkout — including on the order confirmation page — after Shopify removed the ability to inject scripts directly into checkout.liquid.
If you have been struggling to get purchase events firing reliably on your Shopify store since the checkout extensibility update, understanding the Web Pixel API will tell you why previous solutions stopped working and how to fix them properly.
What Is the Shopify Web Pixel API?
The Shopify Web Pixel API is a framework that allows third-party tracking code to run inside a sandboxed environment during checkout. Instead of your tracking script running directly on the checkout page (which Shopify now blocks for security and performance reasons), it runs inside a Web Worker — an isolated browser thread — that Shopify controls.
When Shopify detects that a customer completes a purchase, it passes the order data to your Web Pixel through a secure event system. Your code then reads that data and fires your tracking calls (GA4, Meta Pixel, TikTok, etc.).
Why Shopify Moved to This System
The old checkout.liquid approach allowed any script injected by a merchant to run with full access to the checkout page. This created three problems:
- Security risk — malicious or poorly written scripts could read customer payment data
- Performance risk — slow third-party scripts caused checkout abandonment
- Reliability risk — multiple scripts conflicting with each other broke checkout for some users
The Web Pixel API solves all three by running tracking code in isolation, with no access to the main checkout DOM, and in a way that cannot block or slow down the checkout experience.
How Customer Events Uses the Web Pixel API
When you create a Custom Pixel in Shopify Admin → Settings → Customer Events, Shopify provisions a Web Pixel container for your code. Your pixel subscribes to events like checkout_completed, cart_viewed, and product_added_to_cart. When those events occur, Shopify calls your subscriber function with the event data.
Example event data from checkout_completed:
- order.id — the Shopify order ID
- order.totalPrice.amount — the order total
- order.currencyCode — the store currency
- order.lineItems — array of products purchased
- customer.email — customer email (hashed when passed to pixels)
Your tracking code reads these values and fires events to GA4, Meta, TikTok, or any other platform you need to track.
Which Events Are Available in the Web Pixel API
Shopify exposes the following standard events through the Customer Events system:
- page_viewed — any page view across the storefront
- product_viewed — product detail page viewed
- collection_viewed — collection page viewed
- search_submitted — search query submitted
- product_added_to_cart — item added to cart
- cart_viewed — cart page viewed
- checkout_started — checkout process initiated
- checkout_contact_info_submitted — contact step completed
- checkout_address_info_submitted — address step completed
- checkout_shipping_info_submitted — shipping step completed
- payment_info_submitted — payment step completed
- checkout_completed — purchase confirmed
The checkout_completed event is the critical one. It replaces the old thank you page script trigger for purchase tracking.
Do You Need to Write the Web Pixel Code Yourself?
Not for standard platforms. Meta, TikTok, Google, and most major tracking platforms have already updated their official Shopify apps to use the Web Pixel API. When you install their app and it is up to date, the Customer Events pixel is created automatically.
You only need to write custom Web Pixel code if you are:
- Using a tracking platform that has not yet updated their Shopify app
- Using a custom GTM setup that needs to fire on the order confirmation page
- Sending purchase data to a custom endpoint (e.g. your own data warehouse)
Checking Whether Your Apps Are Using Web Pixel API
Go to Shopify Admin → Settings → Customer Events. Any app that has been updated to use the Web Pixel API will appear here as an active pixel. If Meta, TikTok, or Google do not appear in this list but their apps are installed, their apps have not been updated and are using the old checkout.liquid injection method.
In that case, updating the app or reinstalling it is usually sufficient to provision the Web Pixel connection.
Get Your Shopify Tracking Updated to Web Pixel API
If your purchase tracking dropped after a Shopify update, or if your tracking apps do not appear in Customer Events, a tracking audit will tell you exactly what is using the old method and what needs to be migrated.
Book your free Shopify tracking audit here. We check every tracking implementation against what the Web Pixel API requires and fix any gaps.