What this measures
A conversion with an amount on it. That is enough to answer the question most analytics setups are really for — which channel brings money, not just traffic — and it needs nothing that identifies the person who paid.
It does not build a customer record, a lifetime value, or a purchase history. Those need an identity that survives across visits, and there is not one here to build them from. If that is the question you have, this is the wrong tool and pretending otherwise would waste your week.
Loading the right build
Revenue handling ships in its own build. Without it, a revenue object on an
event is passed through unprocessed rather than normalised, which is not what you want.
<script defer data-domain="example.com"
src="https://cdn.absolutelyanalytics.com/aa.tagged-events.revenue.js"></script> Sending revenue from JavaScript
window.aa('Purchase', {
revenue: { amount: 49.99, currency: 'USD' },
props: { plan: 'growth' },
}); amount may be a number or a numeric string, so reading a price straight out of
the DOM works. currency is an ISO 4217 alpha-3 code and is upper-cased for you.
If every conversion on your site is in the same currency, set it once on the script tag and leave it off the events.
<script defer data-domain="example.com"
data-revenue-currency="EUR"
src="https://cdn.absolutelyanalytics.com/aa.revenue.js"></script> An amount named on the event always wins over the tag default. The tag default only fills in a currency, never an amount.
Sending revenue from markup
With the tagged-events build loaded as well, a purchase can be declared on the
element itself. Two reserved property names carry the money.
<button
data-aa-name="Purchase"
data-aa-revenue-amount="49.99"
data-aa-revenue-currency="USD"
data-aa-plan="growth">
Complete order
</button> revenue-amount and revenue-currency are lifted out and become the
money on the event rather than ordinary properties. Everything else on the element stays a
property, exactly as on any other tagged event. The
class-based form works too, if attributes are not available to you:
aa-event-revenue-amount--49.99.
How the amount is handled
The amount is stored to the number of decimal places the currency actually has, which is not always two:
| Currency | Decimal places | What is stored |
|---|---|---|
| Most currencies | 2 | 49 becomes 49.00 |
| JPY, KRW, ISK, VND and the other zero-decimal currencies | 0 | 1234.5 becomes 1235 |
| BHD, IQD, JOD, KWD, LYD, OMR, TND | 3 | 1.2345 becomes 1.234 |
Send the amount the customer actually paid, in major units — 49.99, not 4999. The handling above assumes major units and there is no minor-unit mode; sending cents will inflate your revenue by a hundredfold and nothing will warn you.
When it does not work
This is the part worth reading twice, because the failure is quiet on purpose. If the currency is not three letters, or the amount cannot be read as a finite number, the event is still sent — with no money on it. There is no console warning and nothing in the dashboard says an amount was discarded.
The reasoning is that a conversion is worth more than the figure attached to it, so dropping the whole event over a formatting problem would be the worse mistake. The consequence is that you should check a real purchase end to end once, rather than assuming silence means success. The callback tells you the event was sent; only the report tells you the money arrived with it.
Reading it back
Two metrics: total_revenue and average_revenue. Break either down
by any dimension you like — source, campaign, country, device, landing page — through the
Stats API or the dashboard.
Both are Business-tier, along with the API itself. Asking for a revenue metric on a plan that does not carry it returns a payment-required error naming the plan you would need, rather than quietly returning zero.
Common questions
My revenue event fired but there is no money on it. Why?
Because a revenue value that cannot be understood is dropped and the event is sent anyway, without it. That is a deliberate choice — losing a conversion because a price was formatted oddly would be worse — but it does mean the failure is silent.
Three things cause it: a currency that is not three letters, an amount that is not a number and cannot be read as one, and an amount that is infinite or not a number after conversion. Check all three before assuming the report is wrong.
Which currency codes are accepted?
ISO 4217 alpha-3 codes, and they are checked twice. The script accepts any three letters and normalises them to upper case, so usd is fine. The collector then checks the code against the real ISO 4217 list, so a withdrawn code that passes the first check is rejected at the second — the event still arrives, but with no money attached.
Can I send more than one currency?
Yes. Each conversion carries its own currency, so a shop selling in several is recorded honestly rather than being flattened into one. Reports group by the currency you sent; there is no conversion into a base currency and no exchange rate applied anywhere, because doing that silently at collection time would destroy the original figure.
Does revenue work on a pageview?
No. Attach it to a named conversion event. A pageview does not go through the revenue handling at all, so an amount on one is not normalised and should not be relied upon.
Which plan do I need to read revenue back?
Business. Sending a revenue event works on any plan, but the revenue metrics are gated, in the dashboard and in the Stats API alike. It is the same gate that covers funnels, custom properties and the API itself — the incumbent's, reproduced.