Skip to main content
Revenue tracking enables you to monitor monetary value generated from your website. Track purchases, subscription value, and other revenue-generating events to measure your website’s financial impact.

Overview

Revenue tracking captures financial transactions and associates them with:

Transaction Data

Monetary information:
  • Revenue amount
  • Currency type
  • Transaction ID
  • Event name

Attribution Data

Traffic source context:
  • Referrer source
  • UTM parameters
  • User session
  • Geographic location
Revenue tracking requires implementing revenue events in your tracking code. All revenue data is associated with your existing analytics.

Setting Up Revenue Tracking

Prerequisites

Before tracking revenue:
1

Install Tracking Code

Ensure the Umami tracking script is installed on your website.
2

Implement Events

Add custom event tracking to your site.
3

Add Revenue Events

Include revenue data with specific events.

Basic Revenue Event

Track revenue by sending a custom event with revenue data:
umami.track('purchase', {
  revenue: 99.99,
  currency: 'USD'
});
The event name can be any custom name you choose (e.g., ‘purchase’, ‘subscription’, ‘checkout’).

Complete Revenue Event

Include additional context:
umami.track('purchase', {
  revenue: 149.99,
  currency: 'USD',
  // Optional: Additional product information
  product_id: 'PROD-123',
  product_name: 'Premium Plan',
  quantity: 1,
  category: 'subscription'
});

Revenue Event Properties

Required Properties

revenue

Type: NumberDescription: The monetary amountExample: 99.99Notes: Use decimal format, positive numbers

currency

Type: StringDescription: 3-letter currency codeExample: "USD", "EUR", "GBP"Notes: ISO 4217 currency codes

Optional Properties

Add custom properties for detailed analysis:
  • product_id: Product identifier
  • product_name: Product name
  • category: Product category
  • quantity: Number of items
  • transaction_id: Unique transaction identifier
  • payment_method: Payment type used
  • Any other custom properties you need
Include relevant properties to enable detailed revenue analysis and segmentation.

Implementation Examples

E-commerce Purchase

Track completed purchases:
// After successful checkout
function trackPurchase(orderData) {
  umami.track('purchase', {
    revenue: orderData.total,
    currency: orderData.currency,
    transaction_id: orderData.orderId,
    product_id: orderData.productId,
    quantity: orderData.quantity,
    payment_method: orderData.paymentMethod
  });
}

// Example usage
trackPurchase({
  total: 299.99,
  currency: 'USD',
  orderId: 'ORD-2024-001',
  productId: 'WIDGET-PRO',
  quantity: 2,
  paymentMethod: 'credit_card'
});

Subscription Revenue

Track subscription signups:
function trackSubscription(plan, amount, currency) {
  umami.track('subscription', {
    revenue: amount,
    currency: currency,
    plan: plan,
    billing_cycle: 'monthly'
  });
}

// Example: Monthly subscription
trackSubscription('premium', 29.99, 'USD');

Digital Downloads

Track paid content purchases:
function trackDownload(item) {
  umami.track('download_purchase', {
    revenue: item.price,
    currency: 'USD',
    content_type: item.type,
    content_id: item.id,
    content_title: item.title
  });
}

// Example: E-book purchase
trackDownload({
  price: 19.99,
  type: 'ebook',
  id: 'BOOK-123',
  title: 'Analytics Guide'
});

Lead Value

Track estimated value of leads:
function trackLead(leadType, estimatedValue) {
  umami.track('lead_generated', {
    revenue: estimatedValue,
    currency: 'USD',
    lead_type: leadType,
    lead_source: 'contact_form'
  });
}

// Example: High-value lead
trackLead('enterprise', 5000);

In-App Purchases

Track mobile app purchases:
function trackInAppPurchase(item) {
  umami.track('in_app_purchase', {
    revenue: item.price,
    currency: item.currency,
    item_id: item.id,
    item_name: item.name,
    item_type: item.type
  });
}

// Example: Premium feature unlock
trackInAppPurchase({
  price: 4.99,
  currency: 'USD',
  id: 'FEATURE-PREMIUM',
  name: 'Premium Features',
  type: 'upgrade'
});

Revenue Reports

Analyze your revenue data:
1

Navigate to Revenue

Go to your website and select the Revenue tab.
2

View Revenue Metrics

See total revenue, transaction count, and average order value.
3

Analyze by Dimension

Break down revenue by source, page, event, or custom properties.
4

Filter Data

Apply filters to analyze specific revenue segments.

Revenue Metrics

Total Revenue

Sum of all revenue events in the selected period.

Transactions

Number of revenue events tracked.

Average Order Value

Mean revenue per transaction (Total Revenue / Transactions).

Revenue Over Time

Visualize revenue trends:
  • Daily, weekly, or monthly revenue
  • Compare time periods
  • Identify seasonal patterns
  • Track growth trends
The revenue chart automatically adjusts granularity based on your selected date range.

Revenue Analysis

By Traffic Source

Understand which sources drive revenue:

By Referrer

Revenue from each referrer:
  • Social media platforms
  • Partner websites
  • Search engines
  • Direct traffic

By Campaign

Revenue by marketing campaign:
  • UTM campaign tracking
  • Source and medium
  • Campaign ROI
  • Attribution analysis

By Page

See which pages generate revenue:
  • Landing pages that convert
  • Product pages that drive sales
  • Content that leads to purchases
  • Entry points for customers

By Geography

Analyze revenue by location:
  • Country-level revenue
  • Regional performance
  • International market value
  • Geographic expansion opportunities

By Event Type

Compare different revenue events:
  • Purchase vs subscription revenue
  • Product category performance
  • Revenue by event name
  • Custom event analysis

Currency Handling

Umami tracks revenue in multiple currencies:

Multi-Currency Support

// USD transaction
umami.track('purchase', {
  revenue: 99.99,
  currency: 'USD'
});

// EUR transaction
umami.track('purchase', {
  revenue: 89.99,
  currency: 'EUR'
});

// GBP transaction
umami.track('purchase', {
  revenue: 79.99,
  currency: 'GBP'
});
Revenue is stored in the original currency. Reports display revenue grouped by currency.

Common Currency Codes

CodeCurrency
USDUS Dollar
EUREuro
GBPBritish Pound
CADCanadian Dollar
AUDAustralian Dollar
JPYJapanese Yen
CNYChinese Yuan
INRIndian Rupee
Use ISO 4217 standard currency codes for consistency.

Revenue Attribution

Understand what drives revenue:

First-Touch Attribution

Revenue credited to initial source:
  • Where did the customer first arrive?
  • Which campaign brought them in?
  • Original referrer tracking

Last-Touch Attribution

Revenue credited to final source:
  • What was the last touchpoint?
  • Which page preceded purchase?
  • Final referrer before conversion
Umami associates revenue with the session where it occurred, providing last-touch attribution by default.

E-commerce Integration

WooCommerce Example

Add to your order confirmation page:
<?php
if (is_order_received_page()) {
  $order_id = $_GET['order_id'];
  $order = wc_get_order($order_id);
  ?>
  <script>
    umami.track('purchase', {
      revenue: <?php echo $order->get_total(); ?>,
      currency: '<?php echo $order->get_currency(); ?>',
      transaction_id: '<?php echo $order->get_id(); ?>',
      items: <?php echo $order->get_item_count(); ?>
    });
  </script>
  <?php
}
?>

Shopify Example

Add to your thank you page:
{% if first_time_accessed %}
<script>
  umami.track('purchase', {
    revenue: {{ checkout.total_price | money_without_currency }},
    currency: '{{ checkout.currency }}',
    transaction_id: '{{ checkout.order_id }}',
    items: {{ checkout.line_items.size }}
  });
</script>
{% endif %}

Stripe Integration

Track Stripe payments:
stripe.confirmPayment({
  // ... payment details
}).then(function(result) {
  if (result.error) {
    // Handle error
  } else {
    // Payment successful
    umami.track('purchase', {
      revenue: result.paymentIntent.amount / 100, // Convert cents
      currency: result.paymentIntent.currency.toUpperCase(),
      transaction_id: result.paymentIntent.id,
      payment_method: 'stripe'
    });
  }
});

Best Practices

Tracking Implementation

  • Track revenue only once per transaction
  • Include transaction IDs to prevent duplicates
  • Use consistent event names across your site
  • Track revenue at the confirmation step, not the attempt
  • Include relevant context in event properties

Data Quality

Do not track the same transaction multiple times. Use unique transaction IDs and track only on final confirmation pages.
  • Validate revenue amounts before tracking
  • Use correct currency codes
  • Handle refunds separately (negative revenue or separate event)
  • Test in development before production
  • Monitor for duplicate transactions

Security Considerations

  • Don’t expose sensitive payment information
  • Don’t include credit card numbers or CVV
  • Don’t include personal identifying information
  • Track only completed, authorized transactions
  • Use server-side validation when possible

Troubleshooting

Possible causes:
  • Revenue events not properly implemented
  • Wrong event property names
  • Currency code missing or invalid
  • Events firing before tracking code loads
Solutions:
  • Check browser console for errors
  • Verify event properties match requirements
  • Test with known currency codes
  • Ensure tracking code loads before revenue events
  • Check network tab for event requests
Possible causes:
  • Tracking on page reload
  • Multiple confirmation steps
  • User refreshing thank you page
Solutions:
  • Track only on first page load
  • Use transaction IDs to detect duplicates
  • Implement client-side flags
  • Track on server-side webhook instead
Possible causes:
  • Currency conversion errors
  • Decimal point issues
  • Including tax/shipping incorrectly
Solutions:
  • Verify amount calculation
  • Use consistent decimal format
  • Decide on gross vs net revenue
  • Test with known amounts

Revenue Reporting Tips

  • Compare revenue across different time periods
  • Segment revenue by customer type or value
  • Track revenue per visitor (RPV)
  • Monitor conversion rate and average order value together
  • Use revenue data to calculate marketing ROI
  • Filter by traffic source to optimize ad spend

Privacy Considerations

Revenue tracking respects user privacy:
  • No personal information required
  • Transaction amounts are aggregated
  • User identities remain anonymous
  • GDPR compliant tracking
  • No third-party data sharing
Umami’s privacy-first approach means revenue data is collected without compromising user privacy.

Next Steps

Reports

Create revenue reports and analysis

Event Tracking

Learn more about custom events

Goals

Set up conversion goals

Funnels

Track revenue conversion funnels

Build docs developers (and LLMs) love