Revenue tracking
Revenue tracking for custom events: attach an amount and ISO 4217 currency, report it in your site currency with ECB rates, and record refunds.
Add revenue (in major units: dollars, euros…) and an ISO 4217 currency
to any event:
privatus.track('Purchase', { revenue: 49.99, currency: 'EUR', plan: 'pro' })
revenuemay be a number or a numeric string ('49.99'). It's stored as a whole number of hundredths (cents), rounded to two decimals, for every currency.currencyis a three-letter code. When you leave it out, the event's currency setting is used, and if there is none, the site's currency.- Both are removed from the properties and stored as dedicated fields.
- An amount that isn't a number, or is larger than 10 billion (positive or negative), is dropped. The event itself is kept.
| Field | Values | What it does |
|---|---|---|
revenue |
A number or numeric string, in major units. May be negative | The event's amount |
currency |
ISO 4217 code such as USD, EUR (case doesn't matter) |
The currency of revenue for this event |
Event currency (the event's page under Events, or events_update with currency) |
ISO 4217 code | The currency assumed for one event name when a hit sends no currency |
| Site currency (Site settings → General) | ISO 4217 code | The currency reports are shown in, and the last fallback |
Multi-currency#
Each event keeps its original currency and amount. When the event is received, the amount is also converted into the site currency using the European Central Bank reference rate for the event's date (falling back to the latest earlier rate), and reports use that converted amount. Changing the site currency later doesn't convert events already stored.
Rates are fetched from the ECB once a day, so only currencies the ECB publishes a reference rate for can be converted. Revenue in any other currency is stored with the event but left out of report totals, unless it is already in the site currency.
You can break revenue down by channel, referrer, campaign, entry page, country, device, event or any property, in the site currency.
Revenue goals#
A goal has one of three value settings:
| Value | What it does |
|---|---|
| No value | The goal has no value |
| Fixed value | A fixed amount in the site currency (for example $50 per lead), counted once per visit or for every completion |
| Event revenue | The sum of the revenue of the events that completed the goal |
Refunds#
Send a negative amount with the same currency to record a refund as its
own event, for example privatus.track('Refund', { revenue: -49.99, currency: 'EUR' }),
or keep refunds out of analytics and treat revenue as gross.