Pro Plan20 minutesintermediate

E-commerce Analytics Setup

Complete guide to setting up Zenovay analytics for your e-commerce store.

ecommercesetupshopifywoocommercestore
Last updated: January 15, 2025

Set up comprehensive analytics for your e-commerce store with product tracking, revenue attribution, and conversion funnels.

E-commerce Analytics Overview

Zenovay provides specialized features for e-commerce:

FeatureWhat it tracks
Revenue TrackingOrders, revenue, AOV
Product AnalyticsViews, adds to cart, purchases
Conversion FunnelsCart → Checkout → Purchase
Customer JourneyPath to purchase
Cart AbandonmentDrop-offs and recovery

Platform-Specific Setup

Shopify

Option 1: One-click integration

  1. Go to SettingsIntegrations
  2. Click Shopify
  3. Enter your store URL
  4. Authorize the app
  5. Tracking auto-configured

Option 2: Manual installation

  1. Go to your Shopify Admin
  2. Settings → Customer events
  3. Click "Add custom pixel"
  4. Add the Zenovay script:
// Zenovay E-commerce Pixel for Shopify
(function() {
  var script = document.createElement('script');
  script.src = 'https://api.zenovay.com/z.js';
  script.dataset.trackingCode = 'YOUR_TRACKING_CODE';
  document.head.appendChild(script);
})();

// Track page views
analytics.subscribe('page_viewed', (event) => {
  if (window.zenovay) {
    zenovay('page');
  }
});

// Track product views
analytics.subscribe('product_viewed', (event) => {
  if (window.zenovay) {
    zenovay('track','product_viewed', {
      product_id: event.data.productVariant.product.id,
      product_name: event.data.productVariant.product.title,
      price: event.data.productVariant.price.amount,
      currency: event.data.productVariant.price.currencyCode
    });
  }
});

// Track add to cart
analytics.subscribe('product_added_to_cart', (event) => {
  if (window.zenovay) {
    zenovay('track','add_to_cart', {
      product_id: event.data.cartLine.merchandise.product.id,
      product_name: event.data.cartLine.merchandise.product.title,
      quantity: event.data.cartLine.quantity,
      price: event.data.cartLine.merchandise.price.amount
    });
  }
});

// Track purchases
analytics.subscribe('checkout_completed', (event) => {
  if (window.zenovay) {
    zenovay('track','purchase', {
      order_id: event.data.checkout.order.id,
      revenue: event.data.checkout.totalPrice.amount,
      currency: event.data.checkout.currencyCode,
      items: event.data.checkout.lineItems.map(item => ({
        product_id: item.variant.product.id,
        product_name: item.variant.product.title,
        quantity: item.quantity,
        price: item.variant.price.amount
      }))
    });
  }
});

WooCommerce

Install the plugin:

  1. Download Zenovay WooCommerce plugin
  2. Plugins → Add New → Upload
  3. Activate and enter Website ID
  4. Auto-tracks products and orders

Manual integration:

Add to your theme's functions.php:

// Add Zenovay tracking script
add_action('wp_head', function() {
  ?>
  <script
    defer
    data-tracking-code="YOUR_TRACKING_CODE"
    src="https://api.zenovay.com/z.js">
  </script>
  <?php
});

// Track product views
add_action('woocommerce_after_single_product', function() {
  global $product;
  ?>
  <script>
    if (window.zenovay) {
      zenovay('track','product_viewed', {
        product_id: '<?php echo $product->get_id(); ?>',
        product_name: '<?php echo esc_js($product->get_name()); ?>',
        price: <?php echo $product->get_price(); ?>,
        category: '<?php echo esc_js(wc_get_product_category_list($product->get_id())); ?>'
      });
    }
  </script>
  <?php
});

// Track purchases
add_action('woocommerce_thankyou', function($order_id) {
  $order = wc_get_order($order_id);
  ?>
  <script>
    if (window.zenovay) {
      zenovay('track','purchase', {
        order_id: '<?php echo $order_id; ?>',
        revenue: <?php echo $order->get_total(); ?>,
        currency: '<?php echo $order->get_currency(); ?>',
        items: <?php echo json_encode(array_map(function($item) {
          return [
            'product_id' => $item->get_product_id(),
            'product_name' => $item->get_name(),
            'quantity' => $item->get_quantity(),
            'price' => $item->get_total()
          ];
        }, $order->get_items())); ?>
      });
    }
  </script>
  <?php
});

BigCommerce

Add to StorefrontScript Manager:

<script
  data-tracking-code="YOUR_TRACKING_CODE"
  src="https://api.zenovay.com/z.js">
</script>
<script>
  // BigCommerce product tracking
  document.addEventListener('DOMContentLoaded', function() {
    // Product page
    if (typeof BCData !== 'undefined' && BCData.product_attributes) {
      zenovay('track','product_viewed', {
        product_id: BCData.product_attributes.sku,
        product_name: BCData.product_attributes.name,
        price: BCData.product_attributes.price.without_tax.value
      });
    }
  });
</script>

Custom Store

For any platform:

// Initialize tracking
<script
  data-tracking-code="YOUR_TRACKING_CODE"
  src="https://api.zenovay.com/z.js">
</script>

<script>
// Product view
function trackProductView(product) {
  zenovay('track','product_viewed', {
    product_id: product.id,
    product_name: product.name,
    price: product.price,
    category: product.category,
    currency: 'USD'
  });
}

// Add to cart
function trackAddToCart(product, quantity) {
  zenovay('track','add_to_cart', {
    product_id: product.id,
    product_name: product.name,
    quantity: quantity,
    price: product.price,
    cart_value: getCartTotal()
  });
}

// Remove from cart
function trackRemoveFromCart(product) {
  zenovay('track','remove_from_cart', {
    product_id: product.id,
    product_name: product.name
  });
}

// Begin checkout
function trackCheckoutStart(cart) {
  zenovay('track','checkout_started', {
    cart_value: cart.total,
    item_count: cart.items.length,
    items: cart.items
  });
}

// Purchase complete
function trackPurchase(order) {
  zenovay('track','purchase', {
    order_id: order.id,
    revenue: order.total,
    tax: order.tax,
    shipping: order.shipping,
    currency: order.currency,
    items: order.items.map(item => ({
      product_id: item.id,
      product_name: item.name,
      quantity: item.quantity,
      price: item.price
    }))
  });
}
</script>

Essential E-commerce Events

Standard Event Schema

EventRequired PropertiesOptional
product_viewedproduct_id, product_nameprice, category, variant
add_to_cartproduct_id, quantityprice, cart_value
remove_from_cartproduct_idquantity
checkout_startedcart_valueitem_count, items
purchaseorder_id, revenueitems, tax, shipping

Product Properties

{
  product_id: "SKU-123",           // Required
  product_name: "Blue T-Shirt",    // Required
  price: 29.99,                    // Recommended
  currency: "USD",                 // Recommended
  category: "Apparel/T-Shirts",    // Optional
  variant: "Large/Blue",           // Optional
  brand: "Acme",                   // Optional
  quantity: 1                      // For cart events
}

Setting Up Conversion Funnels

E-commerce Funnel

Create the purchase funnel:

  1. Go to GoalsFunnels
  2. Click Create Funnel
  3. Add steps:
StepEvent/Page
1Product Viewed
2Add to Cart
3Checkout Started
4Payment Info Added
5Purchase Complete

Category Funnels

Track category-specific behavior:

  • Homepage → Category → Product → Cart → Purchase
  • Useful for merchandising optimization

Revenue Dashboard Setup

Enable Revenue Tracking

  1. Go to SettingsE-commerce
  2. Enable Revenue Tracking
  3. Set default currency
  4. Configure revenue attribution

Key Metrics

The Revenue tab shows:

  • Total Revenue: Sum of all orders
  • Orders: Transaction count
  • AOV: Average order value
  • Conversion Rate: Visitors to purchasers
  • Revenue per Visitor: RPV metric

Attribution Settings

Choose how revenue is attributed:

  • Last Click: Credit to final traffic source
  • First Click: Credit to discovery source
  • Linear: Equal credit to all touchpoints

Product Analytics

Track Product Performance

View in AnalyticsProducts:

  • Most viewed products
  • Best sellers
  • Conversion rates by product
  • Revenue by product

Category Performance

Group products by category:

  1. Include category in product events
  2. View category analytics
  3. Compare category conversion rates

Cart Analytics

Track Cart Behavior

Automatic metrics:

  • Add to cart rate
  • Cart abandonment rate
  • Average cart value
  • Items per cart

Cart Events

// Cart updated
zenovay('track','cart_updated', {
  cart_value: 149.99,
  item_count: 3,
  items: [...]
});

// Cart viewed
zenovay('track','cart_viewed', {
  cart_value: 149.99,
  item_count: 3
});

Testing Your Setup

Verify Tracking

  1. Open your store

  2. Enable debug mode:

    localStorage.setItem('zenovay_debug', 'true');
    
  3. Perform actions:

    • View a product
    • Add to cart
    • Start checkout
    • Complete test purchase
  4. Check console for events

  5. Verify in Zenovay dashboard

Test Purchase

Make a test purchase:

  1. Use test payment if available
  2. Complete full checkout
  3. Verify order appears in Revenue
  4. Check product attribution

Common Issues

Revenue Not Showing

  • Check purchase event fires on thank you page
  • Verify revenue property is a number
  • Ensure event fires after script loads

Products Not Tracked

  • Verify product_viewed event fires
  • Check product_id is consistent
  • Ensure script is on all product pages

Cart Abandonment Wrong

  • Track checkout_started consistently
  • Fire purchase only once per order
  • Don't track refunds as purchases

Best Practices

  1. Use consistent product IDs

    • Same ID across all events
    • SKU or database ID works well
  2. Include all transaction data

    • Revenue, tax, shipping
    • All line items
    • Currency code
  3. Track the full journey

    • From first visit to purchase
    • Include all touchpoints
  4. Test thoroughly

    • Verify on staging first
    • Test all product types
    • Confirm funnel accuracy

Next Steps

Was this article helpful?