Skip to main content
Zenovay
Pro Plan8 minutesIntermediate

Shopify: tracking checkout completion in Shopify

Capture every successful Shopify checkout as a Zenovay revenue event using Shopify's native order-status page or the customer-events pixel.

shopifyintegrationsrevenueecommercecheckout
Last updated:

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.

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.

  1. In your Shopify admin, go to Settings → Customer events → Add custom pixel.
  2. Name it "Zenovay tracker".
  3. 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
      }
    })
  });
});
  1. 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

  1. Place a test order on your store (use Bogus Gateway in dev mode if you don't want to charge a real card).
  2. Within ~30 seconds, the purchase event should appear in Live → Events in your Zenovay dashboard.
  3. 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_CODE is 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.

Was this article helpful?