E-commerce Tracking

Track revenue, orders, and shopping behavior on your e-commerce site. Pipetrace provides simple methods to capture purchase data without complex setup.

Tracking Revenue

Use the pipetrace.revenue() method to track purchases:

// Basic revenue tracking
pipetrace.revenue(99.99)

// With currency (defaults to USD)
pipetrace.revenue(79.99, 'EUR')

// With order ID for deduplication
pipetrace.revenue(149.99, 'USD', 'ORDER-12345')

Complete Purchase Example

// After successful checkout
async function onCheckoutComplete(order) {
  // Track the revenue
  pipetrace.revenue(
    order.total,
    order.currency,
    order.id
  )
  
  // Optionally track as a goal too
  pipetrace.goal('purchase', order.total, {
    items: order.items.length,
    coupon: order.coupon || null
  })
}

Shopping Behavior

Product Views

// Track when users view a product
pipetrace.track('product_viewed', {
  product_id: 'SKU-123',
  product_name: 'Wireless Headphones',
  price: 79.99,
  category: 'Electronics'
})

Add to Cart

pipetrace.track('add_to_cart', {
  product_id: 'SKU-123',
  product_name: 'Wireless Headphones',
  price: 79.99,
  quantity: 1
})

Checkout Started

pipetrace.track('checkout_started', {
  cart_total: 159.98,
  item_count: 2
})

Platform Integration

Shopify

Add this to your checkout.liquid or use Shopify's Web Pixels:

{% if first_time_accessed %}
  <script>
    pipetrace.revenue(
      {{ checkout.total_price | money_without_currency }},
      '{{ checkout.currency }}',
      '{{ checkout.order_id }}'
    )
  </script>
{% endif %}

WooCommerce

Add to your thank you page template:

<?php if (is_order_received_page()): ?>
  <script>
    pipetrace.revenue(
      <?php echo $order->get_total(); ?>,
      '<?php echo $order->get_currency(); ?>',
      '<?php echo $order->get_id(); ?>'
    )
  </script>
<?php endif; ?>

Revenue Reports

In your dashboard, you'll see:

  • Total Revenue - Sum of all tracked purchases
  • Orders - Number of unique order IDs
  • Average Order Value - Revenue divided by orders
  • Revenue by Source - Which channels drive sales

Deduplication

Always pass an order ID to prevent duplicate tracking from page refreshes. Pipetrace automatically ignores revenue events with the same order ID within 24 hours.