On this page
What this issue is
After checkout, WooCommerce sends the customer to a URL like /checkout/order-received/1234/?key=wc_order_abc. Most tracking plugins and tags hang the purchase event on that page load. Nothing in the page knows whether the event was already sent.
So if the customer reloads the page, opens the link again from the confirmation email, or comes back through the browser history, the purchase event fires again. Each hit can send the same order value to GA4, Google Ads, Meta and other platforms.
- CheckoutCustomer pays
- Order-received pagePurchase event sent once
- Reload or revisitSame URL loads again
- Duplicate purchaseSame order counted again
- Inflated reportsRevenue and ROAS overstated
The first load is correct. Every later load of the same URL repeats the event.
Why it costs you leads or sales
The duplicates do not lose a sale directly. They corrupt the data you use to spend money. Revenue and conversion counts rise, so a campaign can look more profitable than it is.
Ad platforms that optimise on conversions (such as Google Ads smart bidding or Meta) learn from inflated signals. That can push budget toward the wrong campaigns. Reports in GA4 and your ad accounts also stop matching your WooCommerce orders, which makes everyone distrust the numbers.
Example: 100 real orders in WooCommerce, where some customers reload or revisit the thank-you page. Numbers are illustrative.
How to check if your site has it
Place a test order
Use a low-value product or the payment gateway's test mode. Do not use real card details on a live store unless you intend to pay.
Open the tag debugger
Use GTM Preview mode, GA4 DebugView, or the Meta Pixel Helper and Google Tag Assistant browser extensions.
Note the first purchase event
Check that it carries a transaction_id (or event ID for Meta) and the right value.
Reload the order-received page
Press refresh, then open the same URL in a new tab. If a purchase event appears each time, you have the issue.
Compare with WooCommerce
Over a week, compare orders in WooCommerce > Orders with purchases in GA4 and conversions in Google Ads. Consistently higher platform counts point to duplicates.
How to fix it
There are two layers. First, always send the order number as the transaction ID so platforms can de-duplicate. Second, stop the event firing more than once per order. Pick the option that matches how your purchase tag is set up.
Check your tracking plugin's settings
Look in the settings of the plugin that sends purchase events (a GA4, Google Ads or Meta plugin for WooCommerce). Many have an option to fire the purchase only once per order. Enable it if present, and update the plugin to the latest version.
Or add an own once-only flag
If you print the purchase script yourself, use the code in the Custom code tab. It stores a flag in the order meta so the script prints only the first time.
Clear caches
If a caching plugin stores the thank-you page, exclude the checkout and order-received URLs from caching so the logic runs on each load.
Send transaction_id in the dataLayer
Make sure the purchase dataLayer push includes ecommerce.transaction_id set to the WooCommerce order number.
Add a once-per-order condition
Create a Custom JavaScript variable that reads a cookie or localStorage value for the order ID. Set the trigger to fire only when the order ID has not been stored yet.
Store the order ID after firing
Add a small Custom HTML tag that fires after the purchase tag (tag sequencing) and saves the order ID in localStorage. Test in Preview mode with a reload.
Guard the purchase script with order meta
Hook into the thank-you page, check a meta flag on the order and print the tracking script only if the flag is not set. Then set the flag. See the PHP snippet below.
Keep the transaction ID
Pass the order number as transaction_id in the dataLayer or gtag call, so platforms can also de-duplicate on their side.
add_action( 'woocommerce_thankyou', function ( $order_id ) {
$order = wc_get_order( $order_id );
if ( ! $order || $order->get_meta( '_purchase_event_sent' ) ) {
return; // Already tracked, do nothing on reloads.
}
$order->update_meta_data( '_purchase_event_sent', 1 );
$order->save();
?>
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: '<?php echo esc_js( $order->get_order_number() ); ?>',
value: <?php echo (float) $order->get_total(); ?>,
currency: '<?php echo esc_js( $order->get_currency() ); ?>'
}
});
</script>
<?php
}, 20 );How to confirm it's fixed
- The first load of order-received sends one purchase event with the right transaction_id and value.
- Refreshing the page sends no new purchase event.
- Opening the same order link in a new tab or from the confirmation email sends no new purchase event.
- A second, different test order still sends its own purchase event.
- GA4 shows one purchase per transaction_id in Reports > Monetization > Ecommerce purchases.
- Weekly platform conversions are close to WooCommerce orders.
How to prevent it happening again
Changes to themes, tracking plugins or GTM containers can quietly bring the duplicates back. Treat the purchase event as something to retest after every change.
- Always include transaction_id in every purchase event.
- Retest reload behaviour after updating WooCommerce, your tracking plugin or your theme.
- Publish GTM changes only after checking in Preview mode with a reload.
- Exclude checkout and order-received pages from page caching.
- Compare platform conversions with WooCommerce orders each month.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. It runs your real checkout journey on a schedule, checks each step and checks the tracking hits sent to platforms such as GA4, Google Ads and Meta. That tells you whether a purchase hit is sent at the end of a test order. There was no specific check note for this issue, so do not assume FunnelGuard flags a repeated purchase on reload.
What it does not cover: it stops before payment unless your store's test mode is set up, and it does not confirm that repeat visits to the order-received URL stay silent. A duplicate caused by a customer reloading is a behaviour you cover by hand.
Run a test order
Use the gateway's test mode after any change to checkout, theme or tracking.
Reload the thank-you page
Watch GTM Preview or GA4 DebugView and confirm no second purchase event.
Reconcile monthly
Compare WooCommerce orders with GA4 and ad platform purchases and investigate gaps.
FunnelGuard's Free plan covers 1 site and 2 journeys with daily checks and no card, so you can at least be alerted if the purchase hit stops firing altogether.
Questions people ask
Why is my WooCommerce purchase event firing twice?
The purchase event is usually tied to loading the order-received page, so each reload or revisit sends it again. It can also fire twice if two plugins or a plugin and a GTM tag both send it. Test by placing one order and reloading the page while watching a tag debugger.
How do I stop the purchase event firing on page refresh in WooCommerce?
Fire the event only once per order. Store a flag in the order meta (server side) or in localStorage or a cookie (browser side) and skip the event if the order ID is already marked. Also send the order number as transaction_id so platforms can drop repeats.
Does GA4 count duplicate purchases with the same transaction ID?
GA4 can ignore repeat purchase events that carry the same transaction_id, so duplicates are often reduced there. Do not rely on it, because Google Ads, Meta and other platforms de-duplicate differently. Fix the cause on your site.
Why are my Google Ads conversions higher than my WooCommerce orders?
Repeated purchase events from the thank-you page are one common cause, along with two tags firing for the same order. Other causes include counting several conversion actions or different attribution windows. Reload your order-received page while debugging to rule out duplicates.
How do I test if my thank-you page fires the purchase event more than once?
Place a test order, then reload the order-received page and open it in a new tab. Watch GTM Preview, GA4 DebugView or Meta Pixel Helper. More than one purchase event for the same order means the problem is present.
Should I stop the purchase event on the server or in the browser?
A server-side flag is simple and reliable for once-only printing, but it can mark an order as tracked even when the browser never sent the hit. A browser-side check in GTM avoids that. Using a transaction ID on every event is the safest extra layer.
Can FunnelGuard detect duplicate WooCommerce purchase events?
Only partly. It checks that the tracking hits for a test order reach platforms such as GA4, Google Ads and Meta, but it does not confirm that reloading the order-received page stays silent. Check that by hand after any change.
Related issues
- TRK-397WordPress plugin update removed tracking snippetFix guide
- TRK-395Shopify thank-you 'additional scripts' deprecated, purchase lostFix guide
- TRK-390SPA sends page_view twice per routeFix guide
- TRK-392Headless checkout loses tracking from main siteFix guide
- TRK-400Tracking only in site header, funnel pages use blank templateFix guide
- TRK-389SPA route change sends no page_viewFix guide