Skip to content

Send revenue with an event

Add an amount to the custom event that stands for a payment, and we add it up in your site’s currency: on the Overview, on the event’s page, and in Attribution. This guide is for whoever writes the code where a payment succeeds.

Add revenue to an event

Add revenue to the event, and currency when it isn’t your site’s:

Where the payment succeeds
window.track?.("subscription_started", {
  plan: "team",
  revenue: 49,        // a number, in the currency's units: 49 or 49.90
  currency: "USD",    // optional: a three-letter code; without it, the site's
});

Send it once per payment, in the visitor’s browser, once the payment has gone through: on your confirmation page, or when your checkout answers. It’s a custom event like any other, so the same rules and checks apply. On a page that loads fresh, send it once the script has run: a call before then is lost (Send an event).

Each call is a new payment: reloading a confirmation page, or opening it again from the browser’s history, sends it again. Send it only the first time the page shows that payment, for example once your checkout answers, not on every load.

Send it from the browser. Requests made from a server, such as a payment webhook calling us with curl or Node’s fetch, are treated as bots and left out of every number.

What we read

PropertyWhat it takes
revenueA number in the currency’s units, such as 49 or 49.9, or a number written as text, "49.90". Text such as "49,90" or "€49" isn’t read. Up to 1,000,000,000 either way; a negative amount is a refund.
currencyOptional. A three-letter code such as USD; lower case works. Left out or empty, it’s your site’s currency.
  • Both are taken out of the event’s properties and kept as its amount. They count among the event’s 10 properties. currency without revenue stays an ordinary property.
  • An amount we can’t read, or can’t convert, isn’t counted, but the event still is. See Amounts that aren’t counted.
  • Don’t send revenue: null, or NaN, which is sent as null: an event with a null value is refused whole. Leave the property out when there’s no amount.

Where revenue shows

Until the first amount arrives, Settings › General shows “No revenue yet” under the site’s currency. From then on:

WhereWhat you see
OverviewA Revenue tile after Visit duration, and its chart. With the comparison off, the tile’s line says how many payments it adds up, or how much refunds took off.
Goals & eventsA Revenue column for the events and goals that sent an amount in the period.
An event’s pageRevenue and Per conversion tiles, a Revenue column in its breakdown and properties, and, with Individual visits on, the amount of each recent completion.
AttributionWhen the goal’s event sent amounts: a Revenue tile, and Rank by Conversions or Revenue. It credits only the amounts sent with the goal’s own event, so make the event that carries them the goal.
API and MCPRevenue as an amount and its currency, on the Overview, events, goals, and attribution endpoints.
Raw dataEach event’s amount and currency as sent, in events.csv, on sites with Individual visits on.
Sample data · The Overview’s tiles, with Revenue last, compared in money

History imported from Google Analytics brings no revenue: only amounts your site sends to us count.

How it’s counted

  • Revenue is the sum of the amounts sent in the period, in your site’s currency. Refunds come off it. Amounts in other currencies are converted (Currencies and refunds).
  • Per conversion, on an event’s or goal’s page, is revenue ÷ converted visitors: what a conversion was worth on average.
  • Changes are shown in money while both periods have fewer than 30 amounts, where one payment moves a percentage a lot, and as a percentage from there. Per conversion is compared only when both periods have at least 50 converted visitors.
  • Rounding happens only on screen: lists show a rounded amount, with the exact one in its tooltip, and small amounts still add up.

Only the amount

Send the amount and its currency, and nothing that identifies the buyer: no order IDs, names, or email addresses, in the amount’s event or its other properties. We keep the amount and currency as you send them, and convert them when a report is read.