Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 purchase event missing transaction_id: how to fix it

TRK-078High impactDetectedBy FunnelGuardPublished Updated
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

What goes wrong without transaction_id
  • 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.
Where the order ID gets lost
  1. Checkout completedStore creates order #1042
  2. Thank-you page loadsPurchase event is pushed
  3. transaction_id emptyOrder number not passed
  4. GA4 cannot deduplicateRefreshes count as new sales
  5. Reports mismatch storeRevenue cannot be reconciled

The purchase is real, but the event carries no order ID, so what GA4 records cannot be trusted.

Purchases counted for 100 real ordersExample numbers
Purchases counted for 100 real orders (example)Real orders: 100 purchases; GA4 without transaction_id: 118 purchases; GA4 with transaction_id: 100 purchases04590100118100Real ordersGA4 without transacti…GA4 with transaction_…purchases

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

Check a purchase event yourself
  1. Open GA4 DebugView

    In GA4 go to Admin > DebugView. Turn on debug mode with the Tag Assistant or the GA debugger browser extension.

  2. 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.

  3. Open the purchase event

    In DebugView click the purchase event and look at its parameters. You should see transaction_id with your order number.

  4. Check the report

    In Reports > Monetization > Ecommerce purchases, add the Transaction ID dimension. Rows showing (not set) mean the ID is missing.

  5. Check the dataLayer if you use GTMGoogle Tag Manager

    On the confirmation page, type dataLayer in the browser console and find the purchase push. Check that ecommerce.transaction_id has a value.

How to fix it

GA4 purchase event with transaction_idjavascript
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 }
  ]
});
Add transaction_id on your platform
  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.

  2. 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, add transaction_id with a Data Layer Variable for ecommerce.transaction_id.

  3. Preview and publish

    Use Preview mode, place a test order, confirm the ID appears in the tag, then publish.

How to confirm it's fixed

Purchase event before and after

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
Confirmation checks
  • 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

Habits that keep it working
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: params rules.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.