Skip to content

Web

Revenue tracking

Record purchases and analyse revenue by source — on the web and in apps.

Revenue view: revenue, orders, average order value, revenue per day and by source
This is how recorded purchases appear in the "Revenue" view (demo data).

Website

After a successful purchase:

trackd.revenue(49.99, 'EUR', 'order-123')

// Parameters: amount, currency (default: EUR), orderId (optional)

The dashboard shows total revenue, orders, average order value and revenue by UTM source. With an order id, each order is counted once. For online shops see products, funnel, payment status.

Apps

All SDKs have the same method:

Trackd.revenue(4.99, "EUR", "order-123")                     // Android
Trackd.revenue(4.99, currency: "EUR", orderId: "order-123")   // iOS
Trackd.revenue(4.99, currency: 'EUR', orderId: 'order-123');  // Flutter

Where exactly the call belongs (Google Play Billing, StoreKit 2, in_app_purchase, payment providers on the web) is shown in the “Track purchases & revenue” section of each SDK guide: Android, iOS, Flutter, JavaScript. Send it only after a successful purchase — not when “Buy” is clicked and not when purchases are restored.

Conversion: paywall → purchase

Because purchase is a regular event, you can use it as a step in funnels — e.g. screen /paywall → event purchase, counted per session. The Analytics page shows revenue, purchases, average order value and — once it detects a paywall or checkout screen — the paywall → purchase conversion right away (conversion from the Pro plan). The Funnels page offers templates such as “Paywall → purchase”, “Onboarding → paywall → purchase” and “Product → cart → checkout → purchase”, prefilled with your screens and pages.

Online shops: products, funnel, payment status

Shops get their own report on the revenue page: conversion rate, cart abandonment, shop funnel, products (top sellers and “viewed, not bought”) and the list of orders. The plugins for WooCommerce, Shopware, PrestaShop and JTL-Shop send all of this automatically. For custom shops:

// product page
trackd.track('view_item', { product_id: 'W-1042', name: 'Diver watch 300m', price: 1290 })

// "Add to cart"
trackd.track('add_to_cart', { product_id: 'W-1042', name: 'Diver watch 300m', price: 1290, quantity: 1 })

// checkout opened
trackd.track('begin_checkout', { value: 1290, currency: 'EUR' })

// thank-you page: order with lines
trackd.track('purchase', {
  amount: 1305.9, currency: 'EUR', order_id: '10042',
  status: 'paid',            // or 'pending' for prepayment / bank transfer
  items: [
    { id: 'W-1042', name: 'Diver watch 300m', category: 'Watches', price: 1290, quantity: 1 },
    { id: 'B-7', name: 'Leather strap', price: 15.9, quantity: 1 },
  ],
})

The SDKs (version 1.2.0 and later) have dedicated methods:

// JavaScript SDK (npm @trackdone/sdk 1.2.0+)
trackd.revenue(1305.9, 'EUR', '10042', { status: 'pending', items: [{ id: 'W-1042', name: 'Diver watch 300m', price: 1290, quantity: 1 }] })
trackd.viewItem({ id: 'W-1042', name: 'Diver watch 300m', price: 1290 })
trackd.addToCart({ id: 'W-1042', name: 'Diver watch 300m', price: 1290 }, 1)
trackd.beginCheckout(1290, 'EUR')
Trackd.revenue(1305.9, "EUR", "10042", listOf(TrackdItem("W-1042", "Diver watch 300m", price = 1290.0)), pending = true) // Android
Trackd.viewItem(TrackdItem("W-1042", "Diver watch 300m", price = 1290.0))
Trackd.revenue(1305.9, currency: "EUR", orderId: "10042", items: [TrackdItem(id: "W-1042", name: "Diver watch 300m", price: 1290)], pending: true) // iOS
Trackd.addToCart(TrackdItem(id: "W-1042", name: "Diver watch 300m", price: 1290), quantity: 1)
Trackd.revenue(1305.9, orderId: '10042', pending: true, items: const [TrackdItem(id: 'W-1042', name: 'Diver watch 300m', price: 1290)]); // Flutter
Trackd.beginCheckout(value: 1290, currency: 'EUR');
  • Lines (items): up to 50 per order; fields id / product_id / sku, name, category, price, quantity (GA4 names such as item_id, item_name work too). They give revenue and units sold per product.
  • No duplicate orders: each order id is counted once — reloading the thank-you page does not add revenue. This needs an order_id, so always send one.
  • Payment status: status: 'pending' for orders that are not paid yet (prepayment, bank transfer). They show as “pending” and count as revenue once marked as paid.
  • Cancellations and refunds: in the orders list (owners and admins) via the order’s menu — “Mark as paid”, “Cancel order”, “Enter refund”. To connect your shop backend, use API v1 with an API key that may change orders. The public tracking script deliberately cannot cancel or refund orders.
  • Funnel: visits → viewed product → cart → checkout → purchase, counted per visit that reached the step. Cart abandonment = visits with add_to_cart but no order.

How it works

revenue sends an event purchase with { amount, currency, order_id } (order id: max. 100 characters). A purchase event you send yourself with a numeric amount is recorded the same way — handy for server-side reporting via the collect API.

Edge cases

  • Currency: ISO 4217 code of 3 uppercase letters, e.g. EUR, USD, CHF (default: EUR). Nothing is converted: the key figures use the currency with the most orders, other currencies are listed separately.
  • Rounding: amounts are rounded to 2 decimal places.
  • Refunds: amounts ≤ 0 (e.g. refunds sent as a negative amount) are not counted as revenue — the event itself still appears under Events. Enter refunds and cancellations in the orders list or via API v1 (see above).
  • Late events: purchases older than 72 hours are dropped (applies to all events).

Order ids must not contain personal data. Use your internal order number, not the customer’s email address.

Ready in minutes

Start the 7-day free trial (no credit card), add your website or app, copy the snippet.

Start free trial