Skip to content

Tracking revenue

Send the order value with the event you already send when someone buys, mark that event as a revenue goal, and the dashboard shows revenue, orders, average order value and conversion rate, with a revenue column on sources, countries and devices. Nothing about the buyer is needed or stored: no order number, no customer id.

1. Send the amount with an event

With the script, add revenue to a custom event. It needs the queue snippet from custom events, so a call made before the script loads isn't lost.

order confirmation page
<script>
  nordtally('event', 'purchase', { revenue: { amount: '1249.00', currency: 'DKK' } })
</script>

From your server, with the Node SDK or the HTTP API, send the same object. Send it from the buyer's own request with their address and user agent, so the order joins their visit and its source; without them it counts, but isn't linked to a visit.

checkout handler
nordtally.track({
  name: 'purchase',
  url: 'https://shop.dk/kvittering',
  ip: req.ip,
  userAgent: req.headers['user-agent'],
  revenue: { amount: order.total, currency: 'DKK' },
});
  • amount is a number or a decimal string in the currency's main unit: '1249.00' is 1,249 kroner, not øre. It must be 0 or more; amounts are kept to 3 decimals.
  • currency is an ISO 4217 code such as DKK, SEK, NOK, ISK or EUR.
  • Revenue is kept on custom events only. On page views, and on the cart and checkout events of Google Analytics 4 (add_to_cart, begin_checkout, view_item and the like, whose value is a cart value, not revenue), it is left out.
  • If the amount or the currency isn't valid, the event is still counted and only the revenue is left out. The Compliance page counts how often that happened, by reason.
  • Don't send order numbers, customer ids or email addresses in properties. An order number is a key into your customer records.

2. Make it a revenue goal

In the site settings, add a goal for the event and tick Counts as revenue, or choose Count revenue on an existing event goal. Only revenue goals are reported, so you can turn it on after the fact: amounts sent earlier show up straight away. Refunds aren't supported yet; don't send them as a revenue goal.

3. Currencies and conversion

Amounts are stored in the currency they were sent in. Each site has a reporting currency (the euro or any of the 29 currencies the European Central Bank publishes a rate for), which you can change at any time in the site settings, past numbers included.

  • An amount in another currency is converted when it is shown, with the ECB euro foreign exchange reference rates. An order uses the rate of the last working day before the day it was placed (in UTC), so a day's figures don't change once the day has started. Weekends and holidays use the last published rate.
  • Between two currencies other than the euro, the rate goes through the euro: the amount times the reporting currency's rate, divided by the original currency's rate.
  • A currency the ECB doesn't publish (AED, for example) isn't guessed: those orders are listed beside the total as not converted, with their own amounts.
  • The dashboard shows the original currencies under the revenue figures. Converted amounts say so, with "Source: ECB statistics".

The ECB publishes its rates for information only. Revenue in Nordtally is analytics, not bookkeeping: use your shop or payment provider for accounting figures. Nordtally fetches the rates once a working day from the ECB's website; the request carries no data about you or your visitors.

Small groups and exact amounts

You hold your order records, so an exact amount in a small group can point to one buyer: "one order of 1,234.50 kr. from this forum on 2 November" tells you who came from there. So Nordtally shows revenue for a source, channel, campaign, country, browser, operating system or device, and for any filtered view, only when at least 5 buyers are in it. A buyer is a visitor with an order; each order sent without the buyer's address counts on its own.

  • Values below that show a dash. If together they have at least 5 buyers, the table says how much they add up to; otherwise it doesn't, since a single dashed row next to the total would give its amount away.
  • If the site has a privacy floor above 5, the higher one applies; shared dashboards apply the shared floor the same way.
  • Totals and the plain daily chart are exact. Revenue is never shown per hour, there is no daily revenue chart under filters, and the realtime view shows no amounts.
  • Under sampling (very large ranges, see how Nordtally counts) revenue and orders are estimates and marked ≈ like every other estimate.

Which source an order is credited to

In anonymous and consented mode an order is credited to the source of the visit it happened in: how that visit arrived, the same first touch the sources panel shows. There is no attribution across visits or days. In strict mode Nordtally can't follow a visit, so it shows revenue totals only, not by source, country or device.

In the Stats API

Ask for revenue, orders, average_order_value or conversion_rate by name in metrics. See the Stats API.

Not yet

Line items and product reports, refunds, duplicate-order detection and a checkout funnel template are planned. Order numbers will never be stored, not even hashed.