A Shopify store using GTM (Google Tag Manager) for GA4 (Google Analytics 4) tracking is experiencing intermittent duplicate purchase events—some transactions show 2 purchase events with only 1 page view. The issue cannot be consistently reproduced in test environments.
Key observations:
Duplicates occur randomly, not for every transaction
Pattern shows duplicates appearing approximately every 2-3 days
May correlate with specific payment methods (PayPal, Shop Pay)
Using first_time_accessed or post_purchase_page_accessed variables as conditions hasn’t resolved the issue
Proposed solutions:
Implement localStorage checking (from WooCommerce discussion): Store order numbers locally to prevent duplicate firing when browsers reload pages without server requests (e.g., returning to an open tab days later)
Check if Shopify’s Google Channel App is sending its own data layer, potentially causing conflicts
Verify that both GA4 and GTM aren’t simultaneously firing purchase events—consider disabling one
Ensure GTM is properly installed in theme header/body per official instructions
Status: No confirmed resolution yet; participants are testing the localStorage approach and investigating potential conflicts between GTM tags and Shopify’s native Google integration.
Summarized with AI on November 2.
AI used: claude-sonnet-4-5-20250929.
Hello.
We are running GA4 measurements with GTM embedded in our Shopify store.
It is generally working fine, but the purchase event is occasionally firing in duplicate.
I checked the search report and found several pages with 2 purchase events and 1 display count. (Not all, but only some of them.)
We created a test environment and ran the operation several times, but the same phenomenon did not occur.
I think that GTM is probably sending the purchase event twice, but I have no idea why this is happening.
I have written the js to send the event as window.dataLayer.push and send it only once on the page.
I would appreciate any information you can give me if you are having similar problems or if you have solved the problem.
Thank you in advance.
Hello! We see the same in our store! We’ve checked this other topic but don’t have duplicate transactions for every transaction. Just some random duplicate transactions. We couldn’t reproduce this in our test environment.
I fear this could be an error with first_time_accessed function or some Shopify error there.
Another theory I have is when users select PayPal as payment provider. Can you check this @nni in your store? I also saw a duplicate order that paid with Shop Pay…
This is the relation between date and transactions. The strange thing is that this occurs almost every 2-3 days.
"The issue seems to be that in certain scenarios some devices/browsers will reload a page locally (and re-run scripts) without a server request. For example, when a customer completes an order on their phone, then leaves the browser with the page still open. When they return to it several hours or days later the page gets reloaded without a full refresh.
The suggested fix is quite simple. In addition to the server side protection, we add a localStorage item with the order number and check against that before firing a second time."
I’m gonna try that suggestion and let you know if it works
Hello! We observing the similar issue that 2 purchase events were captured by GA4 measurements via GTM tag for the same Transaction ID. Anyone solved this double purchase event counting problem?
If you have the Google app installed on your Shopify instance this is already sending the purchase data to GA4 —make sure you don’t have the GA4 tag active in GTM this might be causing the duplicates.
Next make sure you have the GTM tag properly installed in your Shopify theme’s header and body per the instructions. If you’re looking to track specific events for example you’re using Google Ads, add those particular events you want to track in GTM and confirm the conversion IDs all match