Sub topic 14
How revenue metrics are calculated
This chapter assumes you can send a purchase event with an items array and a transaction_id, and that you can read a standard GA4 report. It explains which parameters each revenue metric reads. It also covers how refunds change the totals and why GA4 numbers often differ from your order system.
Event-scoped and item-scoped revenue
GA4 revenue metrics fall into two groups, depending on where they read their data.
- Event-scoped metrics read parameters on the event itself. Purchase revenue sums the
valueofpurchaseevents. - Item-scoped metrics read the
itemsarray. Item revenue sumsprice × quantityacross items.
The two groups answer different questions. Event-scoped metrics answer "how much did these orders bring in". Item-scoped metrics answer "which products brought it in".
The core metrics
| Metric | Scope | What it reads |
|---|---|---|
| Purchase revenue | Event | `value` on `purchase` (and `in_app_purchase`) events |
| Item revenue | Item | `price × quantity` for items in purchase events |
| Transactions | Event | Count of distinct `transaction_id` values |
| E-commerce purchases | Event | Count of `purchase` events |
| Items purchased | Item | Sum of `quantity` in purchase events |
| Refund amount | Event | `value` on `refund` events |
| Total revenue | Event | Purchase, subscription and ad revenue, less refunds |
Total revenue is a broader figure. It also includes subscription and ad revenue if your property collects them. If it collects neither, Total revenue is purchase revenue less refunds.
GA4 adjusts its definitions from time to time. Check the metric descriptions in your property's report editor before you rely on a figure for finance.
A worked example
Take the purchase from earlier chapters.
gtag('event', 'purchase', {
transaction_id: 'T_12345',
currency: 'USD',
value: 49.98,
tax: 4.00,
shipping: 5.99,
coupon: 'SUMMER_SALE',
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
price: 24.99,
quantity: 2,
index: 0
}
]
});GA4 records these figures:
- Purchase revenue: 49.98, taken directly from
value. - Item revenue: 24.99 × 2 = 49.98, taken from the items array.
- Transactions: 1, for
T_12345. - Items purchased: 2.
- Tax and shipping: not part of purchase revenue. They are stored as separate parameters. Because
valuewas set to the item total, 4.00 and 5.99 do not appear in either revenue figure.
GA4 does not check that value equals the sum of the items. It uses whatever number you send. If your code sends value: 59.97 (items plus tax plus shipping), purchase revenue becomes 59.97 while item revenue stays at 49.98. The two metrics then disagree, and the gap is your first sign of a mapping error.
You can prevent this by computing value from the items in one place:
function itemsTotal(items) {
const total = items.reduce(
(sum, item) => sum + item.price * (item.quantity || 1),
0
);
return Math.round(total * 100) / 100;
}
const items = [
{ item_id: 'SKU_1001', item_name: 'Trail Running Shoe', price: 24.99, quantity: 2 }
];
console.log(itemsTotal(items)); // 49.98Rounding to cents avoids floating-point results such as 49.980000000000004. GA4 accepts them, but they make comparisons with your order system harder.
Discounts
price is the unit price you want counted. If a product is discounted, send the price after the discount and, if you want to report it, the amount in discount. Item revenue is computed from price, not from price - discount. If you send the full price along with a discount value, item revenue is overstated.
Currency handling
Every event with a value needs a currency parameter in ISO 4217 format, such as USD or EUR. Without it, GA4 cannot interpret the value, and the revenue is not counted. Check this first whenever revenue is missing but purchase counts look right.
GA4 shows reports in the property's reporting currency. It converts events sent in other currencies, using daily exchange rates. A purchase in EUR therefore appears as a converted amount. It will not match the order total exactly, and it may differ from the rate your payment provider used.
How refunds change the numbers
A refund event references the original order by transaction_id. For a full refund, send the transaction ID and no items. For a partial refund, send the value and the items being returned, as in the Measurement Protocol example from the refunds chapter.
Continuing the example, you refund one shoe at 24.99.
- Refund amount: 24.99.
- Purchase revenue: still 49.98, because the original purchase event is unchanged.
- Total revenue: 49.98 − 24.99 = 24.99, in a property with no ad or subscription revenue.
The refund is attributed to the date of the refund event, not the purchase date. In a report for the purchase week, revenue looks complete. The refund appears in the week it was processed. This timing difference is a common reason why a daily comparison with finance data does not match.
Why GA4 and your order system differ
A mismatch of a few percent is normal. Larger gaps usually come from one of these causes:
- Missing events. Ad blockers, consent denial, and pages closed before the tag fires all drop purchases. Server-side sending reduces this.
- Duplicates. Reloading the confirmation page can resend the event. GA4 reduces duplicates that share a
transaction_id, but you should not rely on that. Guard the event in code, for example with a flag stored for each order. - Different definitions. Your order system may include tax and shipping, or count cancelled orders. GA4 counts only what you send.
- Refund timing. See the previous section.
- Currency conversion. Rates differ between GA4 and your payment provider.
When you compare, use Transactions first. If the counts agree and revenue does not, the problem is in value, currency, or the price fields. If the counts disagree, the problem is in collection.
Item dimensions and event metrics
Be careful when you pair an item dimension, such as Item name, with an event-scoped metric, such as Purchase revenue. The result can be misleading, because the metric belongs to the whole order and the dimension belongs to one item in it. Use item-scoped metrics, such as Item revenue and Items purchased, whenever you break results down by product, brand, or category.
Exercise
A store sends a purchase with value 59.97, tax 4.00, shipping 5.99, and one item priced 24.99 with quantity 2. Later it refunds one unit, with value 24.99. In a property with no ad or subscription revenue, what are purchase revenue, item revenue, refund amount, and total revenue, and what does the mismatch between the first two tell you?
Show answer
Purchase revenue is 59.97, because it uses value. Item revenue is 49.98 (24.99 × 2). Refund amount is 24.99. Total revenue is 59.97 − 24.99 = 34.98. The 9.99 gap between purchase revenue and item revenue is the tax plus shipping that was wrongly included in value. The fix is to send 49.98 as value, so total revenue after the refund would be 24.99.