Half of pixel debugging on Shopify is realizing the system is working exactly as designed. The sandbox blocks things on purpose, consent withholds events on purpose, and once you know what's intentional, the genuinely broken cases get fixed in minutes.
This is the mental model, then the checklist.
The sandbox, in two sentences
Custom pixels run in a sandboxed frame with their own private document, which is why loading a tracker SDK works there. App pixels (the ones apps register through the Web Pixels API) run in an even stricter web worker with no document at all.
Either way, the wall between your pixel and the storefront page is the point. Your pixel cannot:
- read or modify the page's DOM (no
document.querySelectoragainst your theme) - touch first-party cookies directly (use the async
browser.cookieAPI the sandbox provides) - see other pixels or their variables
- use the parent page's
window.location(readevent.context.document.locationfrom the event instead)
What it gets in exchange: clean structured payloads on the storefront and checkout, plus init — a snapshot of current state (cart, customer when available, page context) handed to your pixel on load, before any event fires.
The seven-step debug checklist
Work down this list in order. In my experience the fault is found by step 4 nearly every time.
- Is the pixel Connected? Settings → Customer events. Saved-but-disconnected pixels do nothing, and the editor saves without connecting. This is step one for a reason.
- Is consent the gate? If your pixel declares marketing or analytics permissions, Shopify withholds events from visitors who haven't consented. Test from a region without consent requirements, or grant consent in the banner first. Silence here is privacy working, not a bug.
- Turn on Preserve log. Checkout is a navigation; without it your console wipes mid-funnel and you'll wrongly conclude events stopped.
- Log the raw event before any tracker code.
console.log("PIXEL:", event.name ?? "page_viewed", event)at the top of each subscription. If the raw log appears but your tracker shows nothing, Shopify's side is fine and the bug is in your forwarding code or the tracker's setup. - Check for an ad blocker. The pixel sandbox loads fine, but the tracker SDK it tries to fetch (gtag, fbevents) is exactly what blockers block. Test in a clean profile.
- Verify the event actually exists where you expect.
checkout_completedfires when the thank-you page renders, not when payment is taken. Our payload reference lists what each event carries and when. - Compare against a known-good event. If
page_viewedarrives butproduct_added_to_cartdoesn't, your theme may be adding to cart in a way that bypasses the standard event. Custom AJAX cart implementations are the usual suspect; the fix is publishing a custom event from the theme.
Reading what you've got: init vs subscribe
Subscriptions tell you what happens next. init tells you what's true right now. If your pixel loads mid-session, the cart already has items no product_added_to_cart event will replay for you:
// State at load time:
console.log("Cart on load:", init.data.cart?.totalQuantity ?? 0);
// Changes from here on:
analytics.subscribe("product_added_to_cart", (event) => {
console.log("Added:", event.data.cartLine.merchandise.product.title);
});
Trackers that need the current cart on every page (some personalization tools do) should read init.data.cart, not try to reconstruct it from events.
When it's genuinely broken
If you've cleared all seven steps and events still don't arrive: disconnect and reconnect the pixel, then re-test in an incognito window with consent granted. Still nothing? Strip the pixel to a single page_viewed console.log and add your code back in halves until the failure returns. The bug is almost always in the half you just added, and it's usually a tracker SDK assuming a real browser page where there isn't one.
That last point is the theme of the whole system: pixels trade page access for checkout access. Once your debugging assumes that trade instead of fighting it, customer events are honestly the most predictable tracking surface Shopify has ever shipped.
Stuck on a setup that won't yield? Get in touch — debugging other people's pixels is a service we genuinely enjoy.

Comments
Every comment here comes from a verified email. Write yours, confirm from your inbox, and it's live.
Loading comments…