Skip to main content
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;

  // Load the Zenovay tracker inside the pixel sandbox
  const script = document.createElement('script');
  script.src = 'https://api.zenovay.com/z.js';
  script.setAttribute('data-tracking-code', 'YOUR_TRACKING_CODE');
  script.defer = true;
  script.onload = () => {
    // ('revenue', amount, currency, properties)
    window.zenovay('revenue',
      Number(checkout.totalPrice.amount),
      checkout.totalPrice.currencyCode,
      {
        order_id: checkout.order.id,
        item_count: checkout.lineItems.length
      }
    );
  };
  document.head.appendChild(script);
});
  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.js';
  script.setAttribute('data-tracking-code', 'YOUR_TRACKING_CODE');
  script.defer = true;
  script.onload = function() {
    window.zenovay && window.zenovay('revenue',
      {{ checkout.total_price | money_without_currency | replace:',','.' }},
      '{{ 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. Open your website's dashboard in Zenovay and switch to the Live View tab. Within ~30 seconds, the new session and conversion should appear.
  3. The revenue should also show up on the Revenue tab.

If the event doesn't appear:

  • Open the order-status page in DevTools → Network tab and look for a request to api.zenovay.com. If it's missing, your snippet didn't run.
  • Check that YOUR_TRACKING_CODE is the correct value. You can find it in your website's install snippet (the data-tracking-code attribute) — see the Shopify integration overview for where it's shown.
  • For Approach 1, view the live pixel preview in Customer Events → [Your pixel] → Test.

Plan availability

Revenue tracking is on the Pro plan and higher. Free-plan stores can still send a purchase goal with either approach, but the Revenue tab and revenue attribution stay locked until you upgrade.

Was this article helpful?