Free10 minutesbeginner

Shopify Integration

Add Zenovay to Shopify - automatic e-commerce tracking, revenue attribution, and customer analytics.

shopifyecommerceintegrationrevenuetracking
Last updated: January 15, 2025

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

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

With Shopify App

Automatically tracked:

  • 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

Automatically tracked with app. Manual setup:

  1. Go to Zenovay → Goals
  2. Create goal "Purchase"
  3. Type: Event
  4. Event name: purchase

Add to Cart Goal

  1. Create goal "Add to Cart"
  2. Type: Event
  3. 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

Standard E-commerce Funnel

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

Setting Up Funnel

  1. Go to Funnels → Create
  2. 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

In Zenovay settings, set:

  • Primary currency for reports
  • Automatic conversion applies

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
});

App Settings

Configuration Options

SettingDescription
Website IDYour Zenovay tracking ID
Track productsEnable product view events
Track cartCart add/remove events
Track checkoutCheckout funnel events
Track ordersPurchase completion
Exclude staffDon't track staff visits

Privacy Settings

SettingDescription
IP anonymizationMask visitor IPs
Cookie consentWait for consent
DNT respectHonor Do Not Track

Troubleshooting

Events Not Tracking

Check:

  • App installed and configured
  • 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?