Skip to content
Features

Revenue Tracking

Record sales and see revenue, transactions and average order value for each site.

What is Revenue Tracking?

Revenue tracking records each purchase as a revenue event with an amount, currency and transaction ID. The Revenue report adds them up so you can see how much your site earns over time.

Revenue Report
Total revenue, transactions, average order value, revenue per day and per currency.
Transaction Details
Store items with each transaction; transaction IDs prevent double counting.

Basic Revenue Tracking

Use window.invoker?.trackRevenue({ amount, currency?, transaction_id?, items? }) to record revenue. amount is in currency units (e.g. 99.99, not cents) and must be a positive number — otherwise the call is ignored with a console warning. Revenue is stored as a revenue event.

Simple Revenue Tracking
Track a transaction with basic information
// Track revenue
window.invoker?.trackRevenue({
  amount: 99.99,
  currency: 'USD',
  transaction_id: 'ORDER-12345'
});

E-commerce Implementation

For e-commerce sites, track detailed transaction information including individual items:

Complete Transaction Tracking
Track order with item details
// On order confirmation page
window.invoker?.trackRevenue({
  amount: 249.97,
  currency: 'USD',
  transaction_id: 'ORD-2026-05-11-8429',
  items: [
    {
      name: 'Concert Ticket - VIP',
      product_id: 'TKT-VIP-001',
      quantity: 2,
      price: 99.99
    },
    {
      name: 'Parking Pass',
      product_id: 'PARK-001',
      quantity: 1,
      price: 49.99
    }
  ]
});

Implementation Examples

<!-- On your order confirmation page -->
<script>
  // Get order data from your backend
  const orderData = {
    id: <?php echo json_encode((string) $order->id); ?>,
    total: <?php echo json_encode((float) $order->total); ?>,
    currency: <?php echo json_encode($order->currency); ?>,
    items: <?php echo json_encode($order->items); ?>
  };

  // The tracking script is deferred, so wait for the page to load
  window.addEventListener('load', () => {
    window.invoker?.trackRevenue?.({
    amount: orderData.total,
    currency: orderData.currency,
    transaction_id: orderData.id,
    items: orderData.items
    });
  });
</script>

Currencies

Invoker doesn't convert currencies. The report shows revenue per currency, and the headline total simply adds the amounts together, so if you sell in several currencies, read the per-currency figures.

Parameters

ParameterTypeRequiredDescription
amountnumberYesAmount in currency units (e.g., 99.99). Must be greater than 0.
currencystringNoISO 4217 currency code (default: "USD")
transaction_idstringNoRecommended. Unique transaction ID. Revenue reports count each transaction ID once, so page refreshes don't double-count. Always send one.
itemsarrayNoArray of purchased items

Item Object Properties

PropertyTypeDescription
namestringProduct name
product_idstringProduct SKU or ID
quantitynumberQuantity purchased
pricenumberUnit price

Viewing Revenue Data

Revenue data is available in the Revenue section of your dashboard:

  1. Navigate to your site dashboard
  2. Click "Revenue" in the sidebar
  3. View total revenue, transaction count and average order value
  4. See revenue per day and per currency for the selected date range

Best Practices

  • Use Transaction IDs: Always include unique transaction IDs to prevent duplicate tracking if users refresh the confirmation page
  • Track on Confirmation Page: Only track revenue on the final order confirmation page after payment is complete
  • Include Currency: Always specify currency for international businesses
  • Add Item Details: Items are stored with the event (as a JSON string) and included in event exports; the Revenue report doesn't break revenue down by product
  • Test Thoroughly: Test revenue tracking on a staging environment before deploying to production

Common Use Cases

SaaS Subscriptions

Track subscription sign-ups and renewals:

window.invoker?.trackRevenue({
  amount: 99.00,
  currency: 'USD',
  transaction_id: 'SUB-' + subscriptionId,
  items: [{
    name: 'Pro Plan - Annual',
    product_id: 'PLAN-PRO-ANNUAL',
    quantity: 1,
    price: 99.00
  }]
});

Event Tickets

Track ticket sales for events:

window.invoker?.trackRevenue({
  amount: 150.00,
  currency: 'USD',
  transaction_id: ticketOrderId,
  items: [{
    name: 'Concert - General Admission',
    product_id: 'EVENT-CONCERT-GA',
    quantity: 2,
    price: 75.00,
    event_date: '2026-06-15'
  }]
});

Digital Products

Track downloads and digital product sales:

window.invoker?.trackRevenue({
  amount: 29.99,
  currency: 'USD',
  transaction_id: downloadId,
  items: [{
    name: 'eBook: Web Analytics Guide',
    product_id: 'EBOOK-001',
    quantity: 1,
    price: 29.99,
    format: 'PDF'
  }]
});