Shopify's checkout runs on a separate domain from the rest of your storefront, so the regular tracker script can't follow visitors through it. To capture checkout completions, use one of the two native Shopify hooks below.
Approach 1 — Customer Events pixel (recommended)
Shopify's Customer Events API runs in a sandboxed iframe across all checkout pages, including the success step. It's the supported way to add tracking pixels in 2026.
- In your Shopify admin, go to Settings → Customer events → Add custom pixel.
- Name it "Zenovay tracker".
- Paste this code:
analytics.subscribe('checkout_completed', (event) => {
const checkout = event.data.checkout;
// Build a beacon-friendly payload
fetch('https://api.zenovay.com/api/event', {
method: 'POST',
keepalive: true,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
tracking_code: 'YOUR_TRACKING_CODE',
event_name: 'purchase',
properties: {
revenue: checkout.totalPrice.amount,
currency: checkout.totalPrice.currencyCode,
order_id: checkout.order.id,
item_count: checkout.lineItems.length
}
})
});
});
- Save and Connect. Customer Events run automatically on every checkout from now on.
Approach 2 — Order Status JS (legacy)
For Shopify Plus stores or older themes that haven't migrated, you can still inject script into Settings → Checkout → Order status page → Additional scripts:
<script>
(function() {
var script = document.createElement('script');
script.src = 'https://api.zenovay.com/_z/script.js';
script.setAttribute('data-tracking-code', 'YOUR_TRACKING_CODE');
script.defer = true;
script.onload = function() {
window.zenovay && window.zenovay('purchase', {
revenue: {{ checkout.total_price | money_without_currency | replace:',','.' }},
currency: '{{ shop.currency }}',
order_id: '{{ checkout.order_id }}'
});
};
document.head.appendChild(script);
})();
</script>
The double-curly Liquid placeholders are filled in by Shopify at order-confirmation time.
Important: what happens with abandoned carts
Neither approach fires for abandoned carts — by design, you only want to count completed purchases. To track abandoned-cart funnel drop-off, install the regular tracker on your storefront and create a funnel: /cart → /checkouts/... → goal purchase.
Verifying it works
- Place a test order on your store (use Bogus Gateway in dev mode if you don't want to charge a real card).
- Within ~30 seconds, the
purchaseevent should appear in Live → Events in your Zenovay dashboard. - The revenue should also reflect in Revenue → Today.
If the event doesn't appear:
- Open the order-status page in DevTools → Network tab and look for the request to
api.zenovay.com. If it's missing, your snippet didn't run. - Check that
YOUR_TRACKING_CODEis the correct value (find it in Zenovay under Settings → Tracking Code). - For Approach 1, view the live pixel preview in Customer Events → [Your pixel] → Test.
Plan availability
Revenue tracking via Shopify is on the Pro plan and higher. Free plan users can use Approach 2 to count purchase events, but the revenue dashboard isn't unlocked.