Skip to main content
Free10 minutesBeginner

Shopify Integration

Add Zenovay to Shopify - automatic e-commerce tracking, revenue attribution, and customer analytics. Learn about shopify in this API integrations guide.

shopifyecommerceintegrationrevenuetracking
Last updated:

Integrate Zenovay with your Shopify store for complete e-commerce analytics, revenue tracking, and customer journey insights.

Manual setup only. Zenovay does not currently provide an official Shopify App or marketplace listing — there is no plug-and-play install. The instructions below show how to add Zenovay tracking to a Shopify store using the standard tracking script and manual JavaScript API calls (which work reliably). Wherever you see references below to a "Shopify App" or "automatic tracking", they describe what is possible with the manual snippets in this article, not a separate installable application.

Installation

Theme Installation

  1. Go to Online Store -> Themes
  2. Click "Actions" -> "Edit code"
  3. Find theme.liquid
  4. Add before </head>:
<script
  defer
  data-tracking-code="YOUR_TRACKING_CODE"
  src="https://api.zenovay.com/z.js">
</script>

Google Tag Manager

If using GTM:

  1. Create a new Custom HTML tag
  2. Add the Zenovay script tag
  3. Trigger on All Pages

Automatic E-commerce Tracking

Trackable Events

These events can be tracked using the snippets below:

  • Product views
  • Add to cart
  • Remove from cart
  • Checkout initiated
  • Payment info added
  • Purchase completed
  • Revenue attributed

Events Tracked

EventWhen
view_productProduct page viewed
add_to_cartItem added to cart
remove_from_cartItem removed
begin_checkoutCheckout started
add_payment_infoPayment entered
purchaseOrder completed

Manual Revenue Tracking

Order Status Page

Add to Settings → Checkout → Order status page:

{% if first_time_accessed %}
<script>
if (window.zenovay) {
  zenovay('revenue', {{ total_price | money_without_currency | remove: ',' }}, '{{ currency }}', {
    order_id: '{{ order.name }}',
    shipping: {{ shipping_price | money_without_currency | remove: ',' }},
    tax: {{ tax_price | money_without_currency | remove: ',' }},
    items: [
      {% for item in line_items %}
      {
        id: '{{ item.sku | default: item.product_id }}',
        name: '{{ item.title | escape }}',
        price: {{ item.final_price | money_without_currency | remove: ',' }},
        quantity: {{ item.quantity }}
      }{% unless forloop.last %},{% endunless %}
      {% endfor %}
    ]
  });
}
</script>
{% endif %}

Product Page Tracking

Add to product template:

<script>
document.addEventListener('DOMContentLoaded', function() {
  if (window.zenovay) {
    zenovay('track', 'view_product', {
      product_id: '{{ product.id }}',
      product_name: '{{ product.title | escape }}',
      price: {{ product.price | money_without_currency | remove: ',' }},
      category: '{{ product.type | escape }}',
      variant: '{{ product.selected_or_first_available_variant.title | escape }}'
    });
  }
});
</script>

Add to Cart Tracking

For Ajax carts, add to theme JavaScript:

// Listen for cart updates
document.addEventListener('cart:added', function(event) {
  if (window.zenovay && event.detail) {
    const item = event.detail;
    zenovay('track', 'add_to_cart', {
      product_id: item.product_id,
      variant_id: item.variant_id,
      product_name: item.product_title,
      price: item.price / 100,
      quantity: item.quantity
    });
  }
});

Customer Identification

After Checkout

{% if customer %}
<script>
if (window.zenovay) {
  zenovay('identify', '{{ customer.id }}', {
    email: '{{ customer.email }}',
    name: '{{ customer.name | escape }}',
    orders_count: {{ customer.orders_count }},
    total_spent: {{ customer.total_spent | money_without_currency | remove: ',' }}
  });
}
</script>
{% endif %}

Account Pages

Add to customer templates:

{% if customer %}
<script>
if (window.zenovay) {
  zenovay('identify', '{{ customer.id }}', {
    email: '{{ customer.email }}',
    name: '{{ customer.name | escape }}'
  });
}
</script>
{% endif %}

Shopify Plus Features

Checkout Extensibility

For Shopify Plus checkout:

// checkout.js
import { extension } from '@shopify/checkout-ui-extensions';

export default extension('Checkout::Dynamic::Render', (root, api) => {
  // Track checkout events
  if (window.zenovay) {
    zenovay('track', 'checkout_step', {
      step: api.step,
      total: api.cost.totalAmount.amount
    });
  }
});

Scripts Editor

For Plus stores, use Scripts:

# Track with custom attributes
Output.cart.attributes["zenovay_session"] = Input.cart.token

Goal Setup

Purchase Goal

Manual setup:

  1. Open your website's dashboard and select the Journeys tab, then the Goals sub-tab
  2. Add a goal named "Purchase"
  3. Type: Event
  4. Event name: purchase

Add to Cart Goal

  1. On the same Journeys → Goals sub-tab, add another goal
  2. Name it "Add to Cart"
  3. Type: Event
  4. Event name: add_to_cart

Newsletter Signup

Track Shopify newsletter forms:

<script>
document.querySelector('[data-newsletter-form]')?.addEventListener('submit', function() {
  if (window.zenovay) {
    zenovay('goal', 'newsletter_signup');
  }
});
</script>

Conversion Funnel

The funnel builder requires a Pro plan or higher. On the Free plan you can still create up to 3 goals and send all of the events above, but the visual funnel view is locked. Revenue reporting (the attribution dashboard) also requires Pro or higher — the zenovay('revenue', ...) calls are accepted on every plan, but the revenue charts and attribution breakdowns only appear on Pro and up.

Standard E-commerce Funnel

Product View     100%
    ↓
Add to Cart      15%
    ↓
Checkout         8%
    ↓
Purchase         4%

Setting Up Funnel

  1. Open your website's dashboard, select the Journeys tab, then the Funnels sub-tab
  2. Create a funnel and add steps:
    • view_product
    • add_to_cart
    • begin_checkout
    • purchase
  3. Save and analyze

Multi-Currency Support

Track in Customer's Currency

<script>
if (window.zenovay) {
  zenovay('revenue', {{ total_price | money_without_currency | remove: ',' }}, '{{ cart.currency.iso_code }}');
}
</script>

Reporting Currency

Each revenue call records the currency code you pass in (for example '{{ cart.currency.iso_code }}'), so revenue is stored in whatever currency the order was placed in. Pass a consistent currency code from your theme so totals stay comparable.

Headless Shopify

Hydrogen/Oxygen

// In your checkout success component
import { useEffect } from 'react';

export function OrderConfirmation({ order }) {
  useEffect(() => {
    if (window.zenovay) {
      window.zenovay('revenue', parseFloat(order.totalPrice.amount), order.totalPrice.currencyCode, {
        order_id: order.id,
        items: order.lineItems.map(item => ({
          id: item.variant.sku,
          name: item.title,
          price: parseFloat(item.variant.price.amount),
          quantity: item.quantity
        }))
      });
    }
  }, [order]);

  return <div>Thank you!</div>;
}

Storefront API

When using Storefront API:

// After successful checkout
const response = await fetch('/api/checkout', {
  method: 'POST',
  body: JSON.stringify(checkoutData)
});

const order = await response.json();

// Track in Zenovay
zenovay('revenue', order.total, order.currency, {
  order_id: order.id
});

What gets tracked

Because this is a manual integration, there is no Zenovay-side settings panel for the Shopify store. What you track is simply a function of which snippets from this guide you add:

SnippetWhat it captures
Base script in theme.liquidPageviews and on-site behaviour across the store
Product page snippetview_product events
Add-to-cart listeneradd_to_cart events
Order status page snippetpurchase events and revenue
Customer identify snippetLinks the visitor to a Shopify customer profile

To skip a category, just omit its snippet.

Troubleshooting

Events Not Tracking

Check:

  • Tracking script added to theme.liquid
  • Website ID correct
  • Not logged in as staff (if excluded)
  • Browser console for errors

Revenue Not Matching

Verify:

  • Currency settings
  • Tax/shipping inclusion
  • Refund handling
  • Test order tracking

Checkout Not Tracking

For checkouts:

  • Script must be on checkout
  • Shopify Plus may need custom setup
  • Test with real checkout

Theme Compatibility

Works with:

  • Dawn
  • Debut
  • Brooklyn
  • All 2.0 themes
  • Most custom themes

Testing

Test Mode

Enable test mode:

  1. Add ?zenovay_debug=true to URL
  2. View console for events
  3. Verify data structure

Test Order

  1. Enable test mode
  2. Complete checkout
  3. Verify in Zenovay real-time
  4. Check revenue attribution

Next Steps

Was this article helpful?