Fix empty purchase transaction IDs in GA4

Find the missing order value and verify that two purchases send different IDs.

Performance creative2 min read

Two test orders appear in the store, but the purchase events sent to GA4 both contain transaction_id: "". Google says it deduplicates purchase events with an empty transaction ID, which can leave purchases undercounted. Check the value sent for each order, then repair the mapping that supplies it. Google Analytics transaction IDs.

Compare the event with the order

In a test checkout, inspect the purchase event in Tag Assistant or GA4 DebugView and expand its parameters. Compare transaction_id with the order ID in your test store. Repeat with a second order.

EventOrderSent transaction ID
First purchaseOrder 104""
Second purchaseOrder 105""

Both values are empty, even though the orders are different. Trace the field from the order system through the data layer or tag variable to the event. A missing field and an empty string are different inputs; Google specifically warns that empty strings are deduplicated together. Purchase event diagnostics.

Send the order's stable value

Map the confirmed order identifier to transaction_id when the purchase event is sent. In the example, order 104 sends T-104, and order 105 sends T-105. If order 104's confirmation page sends the purchase again, the ID remains T-104. Never reuse one fixed ID across orders or include information that identifies the customer.

Repeat the two test orders after the change and inspect both event parameters. If you reopen the first confirmation, inspect any repeated event as well. The first order should retain its ID; the second must have its own. Google says purchase data becomes available in reports after about 24 hours, so use DebugView to inspect the test event and check processed reporting later. Google's purchase-event setup.

If the same order is also measured as a Google Ads website conversion, check that action's count setting and transaction ID separately.

Marketing workflow
All guides
Fix empty purchase transaction IDs in GA4 | Formatry Media — Formatry