Duplication Transactions in Google Analytics 4 (GA4) are a very common problem and often ignored by most. However, if not taken care of then these will lead to overcounting your revenue and transaction counts.
How do I find duplicate Transactions in Google Analytics 4?
In order to see if you have this problem, go to Explore in GA4.
Use Transaction ID as your dimension
Use Transactions as the metrics and construct a free from exploration as shown below:
As you will notice above the "Transactions" metrics shows you 2 for some transactions. That means that transaction was fired twice. Now if you add the revenue data to the above exploration you will see that revenue is double what it should be.
What causes duplicate transactions?
These duplication transactions can happen because of several reasons. Mains ones are
- Wrong triggering of tags in Google Tag Manager
- User book marks a page and visit it again and again
- Refreshing the page while it is still loading
- Hitting the back and forward button in the browser
How to fix these duplicate issues
As per Google Analytics' official version, this can be avoided by using a Unique Transaction Id for each transaction so even when using refreshes the page, Google Analytics can see that it is the same transaction so it will ignore it. But that's not how it works. Google Analytics does not ignore it and duplicates all the values in the transaction.
So next option is to have your developers not fire the tags when the user revisits the page, this works when you are using on-page tags. However, most likely you use (or should be using)a tag manager like Google Tag Manager. I am going to share the solution for those who are using this solution.
Fixing Duplicate Transactions issue with Google Tag Manager
Here are the steps that you will need to take to fix firing the GA4 eCommcere Pruchase tag multiple times
- Create a Custom JS variable to check if the current value of transaction id stored in cookie or local storage matches the the transaction id that you are going to fire or not. This will return true or false (or anything that you want
- Use the return value of the above variable as a condition to fire your purchase tag
- Fire a tag that reads the transaction id and stores it in cookie or local storage for future use.
- Tag in step 3 should be fired right after the purchase tag so that future tags can be presevented.
Google Analytics 4 help and support
We are here to help you with all your Google Analytics needs. Our team can get you up and running in no time and also train you and your team to save you a lot of time so that you can focus on driving the business outcomes rather than configuring Google Analytics 4.
Online Course - If you want to learn on your own then check out Google Analytics 4 Masterclass
Workshop - We conduct the onsite customized workshop. Reach out to us for more details.
Consulting - Reach out to us for more details.