On this page
What this issue is
GA4 is Google's analytics tool. When a customer buys, your site should send a purchase event with details such as value, currency, items and a `transaction_id`. The transaction_id is a unique identifier for the order, usually your order number.
Why it costs you leads or sales
- A page refresh, a back-button visit or a bookmarked thank-you page can count the same order twice, so revenue looks higher than it is.
- You cannot reconcile GA4 purchases against your store or CRM orders, because there is no shared key.
- Reports that show transaction ID list it as (not set), so you cannot see which orders were tracked.
- Ad platforms that import GA4 conversions, such as Google Ads, may optimise on inflated or unreliable numbers.
- Refunds cannot be linked back to the original purchase.
- Checkout completedStore creates order #1042
- Thank-you page loadsPurchase event is pushed
- transaction_id emptyOrder number not passed
- GA4 cannot deduplicateRefreshes count as new sales
- Reports mismatch storeRevenue cannot be reconciled
The purchase is real, but the event carries no order ID, so what GA4 records cannot be trusted.
Example: illustrative numbers only. Without an ID, refreshes and revisits inflate the count; with an ID, GA4 matches your real orders.
How to check if your site has it
Open GA4 DebugView
In GA4 go to Admin > DebugView. Turn on debug mode with the Tag Assistant or the GA debugger browser extension.
Place a test order
Use your store's test mode or a low-value real order that you can refund. Do not enter someone else's card details.
Open the purchase event
In DebugView click the
purchaseevent and look at its parameters. You should seetransaction_idwith your order number.Check the report
In Reports > Monetization > Ecommerce purchases, add the Transaction ID dimension. Rows showing (not set) mean the ID is missing.
Check the dataLayer if you use GTMGoogle Tag Manager
On the confirmation page, type
dataLayerin the browser console and find thepurchasepush. Check thatecommerce.transaction_idhas a value.
How to fix it
gtag('event', 'purchase', {
transaction_id: 'T-10452',
value: 59.90,
currency: 'USD',
tax: 4.90,
shipping: 5.00,
items: [
{ item_id: 'SKU-123', item_name: 'Blue shirt', price: 50.00, quantity: 1 }
]
});Push the ID to the dataLayer
Make sure the page pushes
{ event: 'purchase', ecommerce: { transaction_id: 'T-10452', value: 59.90, currency: 'USD', items: [...] } }with your real order number filled in by your template.Check the GA4 event tag
Open your GA4 Event tag named
purchase. If it sends ecommerce data, tick Send Ecommerce data and choose Data Layer as the source. If you set parameters by hand, addtransaction_idwith a Data Layer Variable forecommerce.transaction_id.Preview and publish
Use Preview mode, place a test order, confirm the ID appears in the tag, then publish.
Find where purchase is sent
Check whether it comes from the Google & YouTube app, a custom pixel under Settings > Customer events, or a theme or third-party app.
Use the order ID in a custom pixel
In a custom pixel, subscribe to
checkout_completedand useevent.data.checkout.order.idastransaction_id. Ensure only one source sends purchase.Turn off duplicate senders
If two tools send purchase, disable one so you do not create two different IDs for the same order.
Check your analytics plugin
With WooCommerce, plugins such as Site Kit or GTM4WP usually send the order ID. Open the plugin's ecommerce settings and make sure ecommerce tracking is enabled.
Look for hand-added code
Search your theme and
functions.phpfor customgtag('event', 'purchase'code. Replace any empty ID with the order number, for example$order->get_order_number().Avoid two senders
Do not run a plugin and a manual snippet together for the same event.
Open ecommerce tracking
In Webflow Ecommerce, purchase data is not sent to GA4 by default. If you added custom code in Project Settings > Custom Code, find the purchase call.
Fill the ID from the order
On the Order Confirmation page, use the order ID element or the Webflow order data to set
transaction_id. Test it with a sample order.
Check the Google Analytics connection
In Marketing Integrations, connect GA4 using the built-in connection, which handles purchase events for Wix Stores.
If you use custom code
In Settings > Custom Code, find your purchase script and make sure it passes the order number. Remove duplicate scripts.
Review the GA4 connection
Under Settings > Advanced > External API Keys or Code Injection, check how GA4 is connected.
Add the order ID on the confirmation page
Use Code Injection > Order Confirmation Page and the
{orderId}placeholder to settransaction_id. Test it with an order.
Read the order ID on the server
Render the real order number into the confirmation page, then pass it to the purchase event as
transaction_id.Keep the value stable
Send the same ID for the same order every time. Never generate it in the browser.
How to confirm it's fixed
Before
- purchase has value and items but no transaction_id
- Transaction ID shows (not set) in reports
- Page refresh adds a second purchase
- GA4 orders cannot be matched to store orders
After
- purchase includes transaction_id with the real order number
- Transaction ID column lists each order
- Repeated events with the same ID are ignored
- You can match each GA4 purchase to an order
- DebugView shows transaction_id on the purchase event.
- The value equals the order number in your store admin.
- A second test order gets a different ID.
- Refreshing the thank-you page does not add a second purchase in reports.
- After a day, the Transaction ID dimension no longer shows (not set) for new orders.
How to prevent it happening again
- Make the order ID a required field in your purchase data layer spec.
- Re-test one order after every theme, checkout, plugin or tag change.
- Keep one sender of the purchase event, not several.
- Compare GA4 purchase counts with store orders each week.
- Document which system owns the order number.
How FunnelGuard handles this
Questions people ask
Why is my GA4 purchase event missing transaction_id?
Usually the code or tag that sends the event does not read the order number. It might be a plugin setting, a data layer push that leaves the ID out, or a custom snippet with an empty variable. Find who sends the purchase event and pass your real order ID into it.
What is transaction_id in GA4?
It is a unique ID for an order, normally your store's order number, sent with the purchase event. GA4 uses it to ignore repeated purchases with the same ID and to show orders by ID in reports.
Does GA4 remove duplicate purchases automatically?
Only when the events carry the same transaction_id. If the ID is missing, GA4 cannot tell that two events are the same order, so each one may be counted as a separate sale.
Why does GA4 show transaction ID as (not set)?
It means the purchase events arrived with no transaction_id value. Fix the event so it sends the order number. Orders already recorded will stay (not set), because GA4 does not update past data.
What should I use as transaction_id?
Use the order number or ID from your store, which is unique to each order. Do not use a random number, a timestamp or the customer's email, because it must stay the same for the same order.
How do I check transaction_id in GA4?
Open Admin > DebugView, place a test order and click the purchase event to see its parameters. You can also add the Transaction ID dimension to an ecommerce report and look for (not set).
Will adding transaction_id fix purchases that fire twice?
It helps, because GA4 ignores repeated events with the same ID. It is better to also stop the double firing at its source, such as on page refresh or on every visit to an order status page.
Related issues
- TRK-077purchase event missing on order confirmationFix guide
- TRK-079purchase fires twice (refresh of thank-you page)Fix guide
- TRK-080purchase fires on every visit to order status pageFix guide
- TRK-082purchase value differs from order totalFix guide
- TRK-093Refunds not sent to GA4Fix guide
- TRK-098Purchase tracked only when customer returns from PayPal/3DS redirectFix guide