Track conversions reliably
If you're tracking purchases with an analytics or ad pixel dropped into your Storefront, you've likely noticed conversions get undercounted — ad blockers and browser privacy settings routinely block or delay client-side scripts. You can fix this by backing up your pixel with a reliable, server-side confirmation.
This combines Custom Code (a client-side pixel) with the Order webhook's Completed Order event (a server-side confirmation that doesn't depend on the customer's browser).
How it works
- Add your analytics or ad pixel script (Google Analytics, Meta Pixel, or similar) via Custom Code, firing on the checkout confirmation page as usual.
- Separately, set up a webhook subscription for Order Events, pointing at your own endpoint. See Using Webhooks.
- When an order reaches completed status, Storefront sends a webhook with
event_type_name: completed_order. - On your server, use this event as your source of truth for conversion tracking, forwarding it to your analytics platform's server-side API if it supports one (most major ad platforms do).
Why both
Your client-side pixel still has value — it can capture browser-level detail server-side data can't, like referrer and device information. But it shouldn't be your only source of truth for whether a conversion happened. Pairing it with the webhook means a blocked or failed pixel no longer means a lost conversion in your reporting.
Related articles
Updated 4 days ago