Skip to content

Shopify custom pixel validator

Paste the JavaScript from Settings → Customer events → your custom pixel. The validator reads it the way Shopify’s sandbox runs it: HTML tags and Liquid that break the whole pixel, event names that never fire, page, cookie and storage calls the sandbox blocks, and purchases without the eventID or transaction_id Meta and Google need to count each sale once.

Checked in your browser as you type. Nothing you paste is sent or saved, and it never goes into the page’s address.

Events right, but Meta still reports more sales than you keep? Connect your store free and Tera Ads shows each campaign’s real profit after refunds, returns and cash on delivery.

Questions

Why did my purchase pixel stop after Shopify’s checkout upgrade?

The upgraded Thank you and Order status pages don’t run Additional Scripts. Tracking moves to Customer events, where a custom pixel takes plain JavaScript, runs in a sandbox instead of on the page, and only hears about an order through analytics.subscribe('checkout_completed', …), with the order on event.data.checkout. Code pasted across as it was usually breaks on the first HTML tag or Liquid.

Can I paste my Additional Scripts into a custom pixel?

Not as they are. Remove the script and noscript tags, replace Liquid such as checkout.order_id and total_price with event.data.checkout.order.id and event.data.checkout.totalPrice.amount, and move the tracking inside analytics.subscribe('checkout_completed', …). Code that read document.cookie or localStorage needs browser.cookie and browser.localStorage instead.

Why does Meta count purchases twice?

Shopify’s Meta app, or your own Conversions API, already sends each purchase from the server. When your custom pixel sends Purchase too, Meta keeps one only if both carry the same ID: eventID as fbq’s fourth argument in the pixel, event_id on the server. Leave it out, or put eventID in the third argument, and Meta counts the sale twice.

Why can’t my pixel read cookies or the page?

A custom pixel runs in a sandboxed frame, apart from your storefront, so document.cookie, localStorage, window.top and document.querySelector can’t see the store’s page. Shopify gives the pixel browser.cookie, browser.localStorage and browser.sessionStorage instead (all async), and the page’s address and title on event.context.

Does this tool upload my code?

No. The checks run in your browser as you type, and the code is only read, never run. It isn’t sent anywhere or saved, and it never goes into the page’s address.