On this page
What this issue is
A GA4 purchase event tells Google Analytics that an order was completed. It is normally sent from the thank-you (order confirmation) page. If that page loads a second time, the same code runs again and the same order is reported twice.
Common triggers are a page refresh, the back and forward buttons, a bookmarked thank-you URL, a link to the page in a confirmation email, and a tag that fires on both page load and a dataLayer event. GA4 can remove some duplicates when they share the same transaction_id, but you should not rely on that alone. It does not help when the ID is missing or changes on each load, and your ad platforms and other tools have no such protection.
- Customer paysOrder is created once
- Thank-you page loadspurchase event sent
- Customer refreshesSame page runs the tag again
- Second purchase sentSame order counted again
- Reports inflatedRevenue and ROAS look too high
The first load is correct. Every later load of the same page repeats the event.
Why it costs you leads or sales
Duplicate purchases do not lose orders, they make your data wrong. Revenue, conversion rate and return on ad spend (ROAS) look better than they are. You may then raise budgets on campaigns that are not really paying back.
The damage spreads further if the purchase is also sent to Google Ads, Meta or other platforms. Their bidding systems learn from conversions. Inflated or repeated conversions teach them to chase the wrong audiences and make your cost per acquisition look lower than it is.
Example: 100 real orders of $50 each, where 20 customers refresh the thank-you page once. GA4 reports 120 purchases.
How to check if your site has it
Place a test order
Use your store's test mode or a low-value real order. Stop on the thank-you page.
Open GA4 DebugView
In GA4 go to Admin > DebugView. Use Tag Assistant or the GA debug extension so your session shows up. Look for the
purchaseevent.Reload the thank-you page
Press refresh, then go back and forward. Watch whether a second
purchaseappears with the sametransaction_id.Check the network tab
In browser developer tools, open Network and filter for
collect. Count requests containingen=purchasefor one visit.Look for repeated IDs in reports
In GA4 Explore, build a free-form report with the dimension Transaction ID and the metric Event count, filtered to the purchase event. Any ID with a count above 1 is a duplicate.
How to fix it
There are two layers. First, always send a unique transaction_id that matches the order number. Second, stop the event from running again for an order that was already reported. The second layer also protects Google Ads, Meta and other tags.
(function () {
var orderId = '{{ORDER_ID}}'; // replace with your order number from the page
var key = 'fg_purchase_sent_' + orderId;
try {
if (localStorage.getItem(key)) return; // already sent
localStorage.setItem(key, '1');
} catch (e) {}
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: orderId,
value: 59.90,
currency: 'USD',
items: [{ item_id: 'SKU123', item_name: 'Example product', price: 59.90, quantity: 1 }]
}
});
})();Pass the order ID
Make sure the dataLayer purchase push includes
ecommerce.transaction_id. Create a Data Layer Variable for it.Add a once-only guard
Create a Custom JavaScript variable that returns false if
localStoragealready holds the order ID, and otherwise stores it and returns true. Keep one purchase trigger only.Use it as a trigger condition
On the trigger for your purchase tags, add the condition that this variable equals true. Apply it to GA4, Google Ads and any other purchase tag.
Remove duplicate tags
In the Tags list, search for any second GA4 purchase tag or a trigger that fires on both All Pages and the custom event.
Find the source of the event
Check which plugin sends purchase: a GA4 plugin for WooCommerce, your theme, or a manual snippet. Use only one.
Update the plugin
Many WooCommerce tracking plugins already mark an order as tracked. Update to the latest version and check the plugin's setting for sending purchase only once per order.
Check for a second tag
Search the theme's header and any tag manager for a duplicate GA4 or gtag purchase call.
Use one source
Under Settings > Customer events, check which pixels send purchase. Remove any manual code added to the checkout or order status page.
Prefer customer events
Shopify's checkout_completed event runs once per order in its pixel sandbox, so send purchase from there rather than from theme code on the order status page.
Test a reload
Reload the order status page and confirm no second purchase is sent.
Fire on the server-confirmed order
Render the purchase code only when the order status is newly paid, and mark the order as reported in your database.
Add the browser guard
Use the snippet above as a second layer so refreshes and back navigation stay silent.
How to confirm it's fixed
Before
- Refresh sends another purchase
- Same transaction_id appears more than once
- Ad platforms record extra conversions
After
- First load sends one purchase
- Refresh and back button send nothing
- Each transaction_id counted once
- A test order shows exactly one purchase in DebugView
- Refreshing the thank-you page sends no second purchase
- Opening the page from the confirmation email sends none
- Back and forward navigation sends none
- Google Ads and Meta conversions also show one hit per order
- The Transaction ID report shows no count above 1 for new orders
How to prevent it happening again
- Keep one owner for purchase tracking: one plugin, one tag or one pixel
- Re-test with a reload after theme, plugin or checkout changes
- Review tag triggers in GTM before publishing a new container version
- Run a monthly Transaction ID duplicates report in GA4
- Compare GA4 orders with your store's order count
How FunnelGuard handles this
FunnelGuard detects this issue only partly. A robot visitor runs your checkout journey on a schedule and checks the tracking hits sent to GA4 and your ad platforms. It counts duplicate purchase hits per run, so if the purchase fires twice during a single pass through the journey, you get an alert with a screenshot and a likely cause.
Test after every change
After any tracking, theme or checkout update, place a test order and reload the thank-you page while DebugView is open.
Schedule a monthly report
Save a GA4 Explore report on Transaction ID and Event count for purchase, and check for counts above 1.
Compare totals
Match GA4 purchases against orders in your store for the same period. A gap above your normal difference suggests duplicates.
You can start on the Free plan (1 site, 2 journeys, daily checks, no card). Paid plans have a 3-day free trial.
Questions people ask
Why is my GA4 purchase event firing twice?
Usually the thank-you page ran its tracking code a second time, because of a refresh, the back button or a link from the confirmation email. It can also be two tags sending the same event, such as a GTM tag and a hardcoded gtag call. DebugView shows which case it is: a duplicate on the first load points to two tags.
Does GA4 remove duplicate purchases automatically?
GA4 can ignore repeated purchase events that carry the same transaction_id. It does not help if the ID is missing or changes each time. Ad platforms such as Google Ads and Meta need their own deduplication, so fix the cause on your site.
How do I stop the purchase event firing when the thank-you page is refreshed?
Send the order number as transaction_id and store a flag in localStorage or a cookie the first time the event fires. If the flag exists for that order, skip the event. Apply the same condition to every purchase tag, not just GA4.
How can I find duplicate transactions in GA4?
In Explore, create a free-form report with Transaction ID as a dimension and Event count as a metric, filtered to the purchase event. Any transaction ID with a count above 1 was reported more than once.
Why is my GA4 revenue higher than my store's revenue?
Duplicate purchase events are a common cause. Others include tax or shipping being included in the value, or test orders being counted. Compare GA4 order counts with store orders and check the Transaction ID report for repeats.
Can FunnelGuard detect a duplicate purchase after a page refresh?
Only partly. FunnelGuard counts duplicate purchase hits within each run of your checkout journey, but it does not reload the thank-you page. Test refreshes by hand after changes.
Does a duplicate purchase also affect Google Ads conversions?
It can, if the same trigger fires your Google Ads conversion tag. Duplicates inflate reported conversions and can mislead automated bidding. Use a once-only guard on every tag, and send a unique order ID with Google Ads conversions too.
Related issues
- TRK-077purchase event missing on order confirmationFix guide
- TRK-078purchase sent without transaction_idFix guide
- TRK-080purchase fires on every visit to order status pageFix guide
- TRK-082purchase value differs from order totalFix guide
- TRK-091ecommerce object not cleared in dataLayer (items leak into next event)Fix guide
- TRK-098Purchase tracked only when customer returns from PayPal/3DS redirectFix guide