GA4 records a sale when a purchase event arrives with a transaction_id, a value, a currency and items. Google says GA4 deduplicates purchase events with the same transaction ID, but that only helps if every copy carries the same real order ID, and Google does not publish the exact mechanics. Most duplicate purchases on WooCommerce and custom sites come from a thank-you page that fires on every load, a plugin and GTM both sending purchase, or a missing or empty transaction ID. Fix them at the source, then confirm with the Transaction ID dimension in GA4.
This guide is for agency teams running GA4 for ecommerce clients outside Shopify (Shopify has its own model, covered in our Shopify conversion tracking guide). It covers how the event should look, what GA4 does with duplicates, the common causes, and how to test.
What a correct purchase event looks like
Google's reference for the purchase event lists transaction_id and items as required, with value and currency conditionally required: if you set value, you must set currency for revenue metrics to be computed accurately. Each item needs an item_id or item_name. tax, shipping, coupon and customer_type are optional.
With GTM, the site pushes the purchase into the data layer under an ecommerce object. Google's Tag Manager examples clear the previous ecommerce object first, so earlier ecommerce data on the page does not leak into this event:
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "100482",
value: 72.05,
tax: 3.60,
shipping: 5.99,
currency: "USD",
items: [
{ item_id: "SKU_12345", item_name: "Tee", price: 10.01, quantity: 3 }
]
}
});
In GTM, Google's documented setup is a Google Analytics: GA4 Event tag with More Settings > Ecommerce > Send Ecommerce data ticked and the data source set to Data Layer, fired on a Custom Event trigger for purchase. You can map each field to data layer variables instead, but the ecommerce option is less to maintain.
Points that cause trouble later:
- Value definition. Google's reference describes
value as the sum of price times quantity for all items, excluding shipping and tax. Some stores send the order total. Pick one, document it, and send the same definition to Google Ads.
- Numbers, not strings with symbols.
72.05, not "$72.05".
- Mark it as a key event.
purchase is the event most ecommerce clients optimize on, so it needs to be a key event and, if Google Ads imports it, the only purchase action set to primary.
How GA4 handles duplicate transaction IDs
Google's help article on transaction IDs is short and worth reading exactly. It says you must add a transaction ID to every ecommerce event to deduplicate transactions from the same user and to properly process refunds, and that GA4 deduplicates purchase events with the same transaction ID. It also says:
- The same transaction ID should not be used across different users.
- Do not send an empty string as the transaction ID. GA4 will deduplicate all purchase events that have
transaction_id="", which collapses many real orders into one.
- Pass a dynamic value. If the tag sends the same ID for different transactions, you can significantly undercount key events.
- The ID should not contain information that identifies the customer.
What Google does not say is how long GA4 remembers an ID or exactly when deduplication happens in processing. So treat it as a safety net, not a fix. You can still find repeated transaction IDs in reports, so prevent the second event from being sent, and use the dedup as a backstop for the cases you could not prevent.
Google Ads is separate
Google Ads has its own transaction ID handling. Google's Ads help says that if two conversions for the same conversion action arrive with the same transaction ID, the second is treated as a duplicate and not counted, and that adding a transaction ID is the recommended option for purchases. It also notes that a GG_ prefix on the ID means your tag did not send one. That deduplication is per conversion action. Two different purchase actions, for example a Google Ads tag and an imported GA4 purchase, will both count the same order. See Google Ads counting conversions twice for that check.
Cause 1: the thank-you page fires on every load
The classic custom-site setup prints the order into the data layer on the order confirmation page. Every time that page renders, the purchase fires again. That happens when:
- The customer reloads the page.
- They bookmark it, or return to it from an order confirmation email link.
- The browser restores the page from history, or reopens tabs after a restart.
If the transaction ID is correct, GA4 may deduplicate some of these. If it is missing, random per page load, or built from a timestamp, every reload is a new sale.
Fixes, from most to least robust:
- Server-side flag. When the confirmation page renders, only output the purchase data layer push if the order has not been marked as tracked, then mark it. This is the cleanest option and works across devices.
- Browser-side guard. Store the order ID in a first-party cookie or
localStorage after the event fires, and skip the push if it is already there. Simple, but it does not survive a different browser or cleared storage.
- Time limit. Only fire if the order was created in the last few minutes. Useful as an extra guard, not on its own.
Some WooCommerce tracking plugins include a guard like this, but check that yours does rather than assuming it.
Cause 2: payment gateway redirects
On WooCommerce, the official Google Analytics for WooCommerce extension tracks purchases on the order received page, and its documentation says this requires a payment gateway that redirects to the thank you / order received page after payment. Gateways that send the customer off-site (PayPal, some Stripe and bank payment flows) create three separate problems:
- Missing purchases. If the customer pays and closes the tab before the redirect back, the thank-you page never loads and no browser purchase is sent.
- Lost attribution. The return from the payment domain can start a new session with the gateway as referrer, so the sale is credited to the gateway. Add the payment domains to GA4's List unwanted referrals (Admin, Data streams, your web stream, Configure tag settings). The guide to GA4 cross-domain tracking and self-referrals covers this.
- Double returns. Some flows send the customer to the confirmation page more than once, for example a return URL plus a later redirect after asynchronous payment confirmation. Without a reload guard, both count.
Test every gateway the client actually uses, not just the default card form. A store that looks fine on card payments can be badly off on PayPal.
Paid vs placed orders
A browser purchase event fires when the customer reaches the confirmation page, which is not always when they paid. Bank transfer, cash on delivery and failed asynchronous payments can all produce a thank-you page for an order that never completes. If the client cares about paid revenue, decide which statuses should count. Some WooCommerce tracking tools can send the purchase from the server when an order reaches a paid status instead of from the browser. That removes reload duplicates and unpaid orders, but you then need to pass the GA4 client ID and session details through to the server, and test it properly.
Cause 3: plugin plus GTM double firing
This is the most common cause we find on WooCommerce. A GA4 plugin sends purchase with gtag, and a GTM container sends it again from a data layer another plugin created. Sometimes the theme or a page builder adds a third Google tag.
Typical combinations:
- Google Analytics for WooCommerce (configured under WooCommerce > Settings > Integration > Google Analytics) plus a GTM container with a GA4 purchase tag.
- A GTM plugin that builds an ecommerce data layer plus a separate pixel manager plugin that also sends GA4.
- The same measurement ID loaded through a Google tag in GTM and a hardcoded gtag in the theme header.
WooCommerce's own documentation for the Google Analytics extension notes that multiple tracking code instances on the same page can cause issues. Decide which system owns GA4 ecommerce events, and switch off ecommerce tracking in the others. Keep in mind that the same plugins often also send Meta and Google Ads events. Meta duplicates are covered in Meta Pixel duplicate events on Shopify and WordPress.
Other causes worth checking
- Trigger mistakes in GTM. A purchase tag fired on a Page View trigger with a URL condition and on the
purchase custom event. Or a trigger that matches every data layer push on the page.
- Missing
ecommerce: null. A later push on the page reuses the purchase object, and a tag reading ecommerce sends it again.
- Single-page app checkouts where the confirmation view mounts twice.
- Server-side and browser both sending after a partial move to server-side GTM.
How to test in DebugView
Enable debug mode with GTM preview or Tag Assistant, which flags your device, then open Admin > Data display > DebugView in GA4. Google notes that events may not appear in debug mode if consent mode is active and you have not consented to analytics cookies, so accept the banner first.
- Place a real test order through each payment method the store uses. Use a test or sandbox mode where the gateway supports it, or a low-value order you refund.
- Count the purchase events. DebugView should show exactly one
purchase. Two in quick succession means two senders.
- Open the event. Check
transaction_id matches the order number in the store admin, value and currency are right, and items are populated.
- Check the network requests. In the browser's network tab, filter for
collect requests to GA4 and count the hits with en=purchase. Two hits to the same measurement ID is a duplicate, even if one is from a tag you did not know about.
- Reload the confirmation page, then open it in a new tab, and confirm no further purchase is sent.
- Check GTM preview for the order: which tags fired on which data layer events.
Filter debug and internal traffic out of reporting, as Google recommends, so test orders do not distort client numbers.
How to spot duplicates in reports
Production data tells you whether the problem is real and how big it is. Ecommerce data typically takes about a day to show up fully in reports.
- Exploration by transaction ID. Build a free-form exploration with the Transaction ID dimension and Ecommerce purchases and Purchase revenue as metrics, sorted descending. Any ID with more than one purchase is a duplicate that got through.
- "(not set)" or blank IDs. A large row of purchases with no transaction ID means the ID is not reaching GA4. Fix the data layer first.
- One ID with huge revenue. A static or empty ID causes collapsed orders, the opposite problem. Revenue looks low and one row looks enormous.
- Reconcile with the store. Compare daily orders and revenue in WooCommerce or the backend against GA4 purchases for the same days. GA4 below the store is normal (consent, ad blockers, gateway drop-off). GA4 above the store is almost always duplication.
- Check the gateway's share of conversions. If a payment domain shows up as a source of purchases, the referral exclusion is missing.
Run the same check in Google Ads with a segment by conversion action to see whether one order is counted by more than one action. The GA4 audit checklist includes these reports as standard steps.
A short fix plan
- Pick one owner for GA4 ecommerce events and disable the rest.
- Make sure every purchase carries the real order ID as
transaction_id, never blank, static or random.
- Add a reload guard on the confirmation page, server-side if you can.
- Exclude payment domains as unwanted referrals and test every gateway.
- Decide whether unpaid orders should count, and move the event server-side if they should not.
- Check the Transaction ID exploration weekly for the first month.
Getting it fixed
Duplicate purchases are usually two or three small issues stacked on top of each other, and each one is quick to fix once found. If you'd rather have this set up and tested for a client, send us one account.