Shopify custom pixels and when to use an app instead
Updated
Shopify custom pixels are JavaScript snippets you paste into Settings, Customer events, which Shopify then runs in a sandboxed worker rather than in your theme. They reach checkout, they survive theme changes, and they are free. What they do not give you is server-side tracking, event deduplication, or a way to manage a dozen pixel IDs without maintaining a dozen snippets.
What replaced theme.liquid tracking
Shopify moved analytics onto the Web Pixels API. Instead of scripts running in your page, pixel code runs in a sandboxed iframe with no access to the DOM or to the shopper session. Shopify feeds it a standard set of events: page_viewed, product_viewed, product_added_to_cart, checkout_started, checkout_completed.
That sandbox is why the method reaches checkout at all. Shopify will not let arbitrary code run on its hosted checkout, but it will emit events to a sandboxed subscriber.
The migration also means additional_scripts and theme snippets are on the way out. Tracking built on either is worth moving now rather than after it breaks.
Writing a custom pixel
In Settings, Customer events, Add custom pixel, you get an editor and an analytics.subscribe API. A minimal Meta pixel means pasting the fbq base code, then subscribing to each Shopify event and mapping it onto the Meta event name with the right parameters.
For one pixel on one platform this is perfectly reasonable, and it costs nothing. Keep in mind you are now maintaining the mapping yourself: when Meta changes a required parameter or Shopify adds an event, nothing updates on its own.
Where custom pixels run out
Server-side tracking is the first wall. The Conversions API needs a request signed with an access token, and putting an access token in client-side sandbox code would expose it to anyone who views the source. Custom pixels cannot do server-side properly, which means the events blockers eat stay lost.
Deduplication is the second. Browser and server copies of the same event need a shared event ID generated somewhere both can see it. There is no server in a custom pixel to generate one.
Then there is volume. Six pixels across Meta, TikTok, Snapchat and Pinterest means six snippets, each with its own event mapping, all edited by hand when something changes.
What an app adds
A pixel app registers one web pixel and fans out to every platform you configure, keeping the access tokens on its own server where they belong.
Pixelfy holds unlimited Facebook, Meta, Instagram, TikTok, Snapchat, Pinterest and Taboola pixels, sends both browser and server-side events, and generates matching event IDs so Meta and TikTok deduplicate the pairs. Per-pixel event assignment means an agency pixel can receive Purchase only while yours takes the full funnel.
At $7.99 a month the question is really how many hours of snippet maintenance you want to own.
A reasonable rule
One pixel, one platform, no agency, and you are comfortable in JavaScript: write the custom pixel. You will not miss what you are giving up.
More than one pixel, more than one ad platform, or any campaign where reported ROAS drives spending decisions: use an app. The moment attribution accuracy affects budget, losing a third of your conversions to blockers costs more than the subscription.
Questions
- Do custom pixels track checkout on all Shopify plans?
- Yes. The Web Pixels API emits checkout_started and checkout_completed on every plan, which is the main advantage it has over the old theme.liquid approach.
- Can a custom pixel use the Conversions API?
- Not safely. The Conversions API requires an access token, and code in the customer events sandbox is visible to the browser. Server-side tracking needs a backend, which is what an app provides.
Related guides
- The Facebook Conversions API on Shopify
How the Meta Conversions API recovers Shopify conversions lost to iOS 14, ad blockers and Safari, what event deduplication does, and how to set it up.
- How to add a Facebook pixel to Shopify
Three ways to add a Facebook pixel to your Shopify store: the Facebook sales channel, a manual theme edit, or a pixel app. Includes how to verify it fires.
- Getting the Shopify Purchase event right
Why Shopify Purchase events go missing, arrive without a value, or count twice, and how to send AddToCart, InitiateCheckout and Purchase correctly to Meta.