Sub topic 20
Common data-quality pitfalls and how to avoid them
This chapter assumes you can already send purchase and refund events with gtag.js or the GTM dataLayer, and that you know the items array and the currency and value parameters. It covers the mistakes that most often make GA4 revenue missing, doubled, or different from your order system. It also covers how to find each one.
Why revenue data goes wrong
GA4 accepts almost any event without complaint. A malformed value or a missing currency still produces an event in DebugView. The event simply contributes nothing, or the wrong amount, to revenue reports. Data-quality work is therefore less about errors on screen and more about comparing GA4 with a source of truth, usually your order database.
Most problems fall into four groups:
- Missing data: the event never fires, or fires without the fields revenue needs.
- Duplicated data: the same order is sent more than once.
- Wrong values: numbers are present but mis-typed, mis-summed, or in the wrong currency.
- Distorted attribution: revenue is credited to the wrong source.
Missing revenue
Missing or invalid currency. GA4 ignores value on an event that has no valid ISO 4217 currency code such as USD. The event appears in reports with a count but no revenue. Always send currency on every event that carries value.
value sent as a string. "$49.98" or "49,98" is not a number. Send 49.98 as a JavaScript number, with a period as the decimal separator, and never include a currency symbol.
Missing item identifiers. Each item needs at least item_id or item_name. Items without either can be dropped from item-level reports. Prefer sending both.
The event does not fire. Common causes are a purchase trigger that depends on a thank-you URL which payment providers sometimes skip, a tag blocked by consent settings, and ad blockers. A gap of a few percent from blockers and consent is normal. A gap of 30 percent usually means a broken trigger.
Payment redirects. If customers pay on a third-party domain and return to your site, the session can restart. Without a referral exclusion, the purchase is credited to the payment provider as a referral. Add the provider's domain to the list of unwanted referrals in the data stream's tag settings.
Duplicated revenue
No transaction_id, or a reused one. GA4 uses transaction_id to recognize that two purchase events describe the same order. If you omit it, reloading or revisiting the confirmation page counts a second purchase. If you reuse a placeholder such as "1", genuinely different orders can be collapsed into one.
Deduplication is not a guarantee everywhere. Reports handle repeated IDs, but the raw BigQuery export keeps every event you sent. Count DISTINCT transaction IDs there. Fix the duplication at the source, because every consumer of the data benefits.
Two implementations at once. A hard-coded gtag.js purchase and a GTM purchase tag on the same page both fire. Check DebugView for two purchase events a few milliseconds apart.
A simple guard on the confirmation page prevents reload duplicates and builds value from the items so the two cannot disagree:
function sendPurchase(order) {
const key = 'ga4_purchase_' + order.id;
if (localStorage.getItem(key)) {
return; // this order was already reported from this browser
}
const items = order.lines.map((line, i) => ({
item_id: line.sku,
item_name: line.name,
price: Number(line.unitPrice),
quantity: Number(line.qty),
index: i
}));
// Items only: tax and shipping go in their own parameters.
const value = Number(
items.reduce((sum, it) => sum + it.price * it.quantity, 0).toFixed(2)
);
gtag('event', 'purchase', {
transaction_id: String(order.id),
currency: order.currency,
value: value,
tax: order.tax,
shipping: order.shipping,
items: items
});
localStorage.setItem(key, '1');
}Note that localStorage protects only one browser. A customer who opens the confirmation link on another device can still trigger a second event, which transaction_id then handles in reports.
Wrong values
Tax and shipping inside value. Revenue should be the item total. Adding tax or shipping inflates GA4 against your accounting figures. Send them in tax and shipping.
Item revenue and purchase revenue disagree. Purchase revenue comes from the event's value. Item revenue comes from each item's price multiplied by quantity. If you apply a discount to value but not to item prices, the two metrics differ. Either put a per-unit discount in each item and keep price as the pre-discount figure, or make sure both sides use the same net numbers.
Mixed currencies. If your shop sells in several currencies, send the transaction currency each time. GA4 converts to the property's reporting currency. Sending an amount in euros labelled USD is silent and common.
Stale ecommerce objects in GTM. Without dataLayer.push({ ecommerce: null }) before each ecommerce push, fields from an earlier event, such as old items, can carry into the next one. Clear the object every time.
Refunds that cannot match. A refund event needs the original transaction_id. Revenue is reduced on the date the refund is received, not the original purchase date, so monthly totals can dip in a later period than the sale.
Distorted attribution and test noise
- Internal and test orders. Staging sites and QA purchases pollute production revenue. Use an internal traffic filter and the developer traffic filter, and send test orders to a separate data stream or property.
- Self-referrals and session breaks. Beyond payment providers, subdomains and cross-domain checkouts need cross-domain measurement configured. Otherwise the purchase appears as "direct" or as a referral from your own shop.
- Processing delay. Standard reports can lag by 24 to 48 hours. Compare complete days, never today.
A reconciliation routine
- Pick a closed day and export order count and net item revenue from your order system.
- Pull GA4 purchases and purchase revenue for the same day and time zone.
- Expect GA4 to be a few percent lower because of consent and blockers. A larger gap means investigate.
- Spot-check three orders end to end in DebugView:
transaction_id,currency, numericvalue, anditems. - Re-run after each release that touches checkout.
| Symptom | Likely cause | Fix |
|---|---|---|
| Purchases counted, revenue is zero | Missing `currency` or string `value` | Send an ISO currency code and a number |
| Revenue about double | Two implementations, or no `transaction_id` | Remove one tag, add a unique ID |
| Revenue higher than orders by a steady percentage | Tax or shipping inside `value` | Move them to `tax` and `shipping` |
| Revenue credited to the payment provider | Missing referral exclusion | Add the provider's domain |
| Item revenue differs from purchase revenue | Discounts applied to only one side | Align `price`, `discount`, and `value` |
Exercise
A shop sends a purchase with transaction_id "A100", currency "USD", value 59.98, tax 5.00, shipping 6.00, and two items priced 24.99 each (quantity 2 for one SKU, 10.00 for a second SKU with quantity 1). GA4 shows 59.98 in purchase revenue for this order, but the order system reports 59.98 for item sales as well. A customer then reloads the confirmation page twice. What revenue should GA4 show for order A100, which value mistake would be visible if shipping were added, and which parameter makes the reloads harmless?
Show answer
Item total is 24.99 x 2 + 10.00 = 59.98, so value 59.98 is correct, and GA4 should show 59.98 once. If shipping and tax were added to value it would be 70.98, which inflates revenue against the order system. The unique transaction_id "A100" makes the reloads harmless in reports, because GA4 treats repeated purchases with the same ID as one order. The raw BigQuery export would still contain the extra events, so count distinct transaction IDs there.