Fixing Ghost Transactions and Duplicate Purchases in GA4
Fixing Ghost Transactions in GA4
📌 Introduction
An ecommerce site noticed GA4 was reporting transactions with $0 revenue value and multiple duplicate purchase events for single orders — corrupting their revenue data and making accurate financial reporting impossible.
❗ The Problem
GA4 showed 340 purchase events in a month where Shopify recorded 189 orders. Revenue in GA4 was $127K while actual revenue was $94K. Ghost transactions ($0 value) and true duplicates were inflating both transaction count and revenue figures significantly.
🔍 Identifying the Causes
Two separate issues were found: (1) The purchase event was configured to fire on the order confirmation page URL without a deduplication check — browser back-button presses and page refreshes re-fired the event. (2) A Shopify app had a GA4 integration that fired a second purchase event using a different data format, creating duplicate hits with inconsistent revenue values (sometimes $0).
⚠️ Consequences for the Business
GA4 revenue data was unreliable for financial reporting. The finance team had stopped trusting analytics and was reconciling manually against Shopify. Google Ads was optimizing against inflated conversion values, causing smart bidding to over-bid on campaigns.
✅ Solution
Implemented transaction ID deduplication: stored the transaction ID in sessionStorage immediately after the first purchase event fired, and added a GTM condition to prevent the tag from firing if the ID already existed in storage. Identified and removed the conflicting Shopify app's GA4 integration. Added the transaction_id parameter to GA4's deduplication configuration in the Admin settings.
📈 Results
Purchase events aligned to within 2% of Shopify order count (the gap explained by legitimate order cancellations). Revenue reporting became accurate. Google Ads smart bidding was reset and re-trained on clean data, resulting in 24% ROAS improvement over 8 weeks.
🏁 Conclusion
Ghost and duplicate transactions are among the most damaging data quality issues in ecommerce analytics. sessionStorage-based deduplication combined with GA4's built-in transaction ID deduplication provides robust protection.
💡 Key Takeaways
Always use sessionStorage to prevent duplicate fires on page refresh. Configure transaction_id as a deduplication key in GA4 Admin. Audit all third-party apps for hidden GA4 integrations — Shopify apps frequently add tracking without disclosure.
Talk to Us, It's Free
We are always willing to help. Let us know what you are looking for, and we will develop a unique solution for you.
Thank You!
Your message has been sent successfully. We'll get back to you soon.
Business Hours
Our support Hotline is available 24 Hours