Sub topic 13
Tracking Refunds in GA4
This chapter assumes you understand the GA4 purchase event, the items array, JavaScript objects, and transaction IDs. A refund is a GA4 event that records money returned to a customer after a purchase. It can represent a complete refund or only part of an order.
How a refund relates to a purchase
A refund should identify the original order with the same transaction_id used by the purchase event. For a partial refund, send the refunded amount and the refunded item quantity. For a full refund, send the complete refunded amount and all refunded items.
gtag('event', 'refund', {
transaction_id: 'T_12345',
currency: 'USD',
value: 24.99,
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
price: 24.99,
quantity: 1
}
]
});The value is the monetary amount being refunded. It should use the currency specified by currency. The items array gives GA4 item-level detail. Its quantities must describe the returned units, not the original order quantity.
For example, if an order contains two shoes at $24.99 each and the customer returns one, send value: 24.99 and quantity: 1. Do not send the original purchase value of $49.98.
Parameters and implementation choices
| Parameter | Purpose | Partial refund example |
|---|---|---|
| `transaction_id` | Matches the original purchase | `T_12345` |
| `currency` | Defines the currency of `value` | `USD` |
| `value` | Total amount returned | `24.99` |
| `items` | Describes returned products and quantities | One unit of `SKU_1001` |
Send a refund after the commerce system confirms it. Sending the event when a customer merely requests a return can overstate refunds if the request is rejected or never completed. Server-side systems are often the best source because they know the final refund status and amount.
A refund event does not replace the original purchase. Keep the purchase event and send the refund separately. This lets GA4 retain the shopping activity while adjusting revenue-related analysis with the returned amount.
Check your data
In DebugView, verify that the event name is refund, the transaction ID matches an existing purchase, and the value and item quantities match the commerce system. Then compare GA4 refund data with your order or payment platform for the same date range.
Exercise
A customer returns one of three $20 items from order T-9. What value, quantity, and transaction_id should the refund event contain?
Show answer
It should contain transaction_id T-9, value 20, and an item entry with quantity 1 for the returned product. The currency must match the order currency.