Duplicate transactions being recorded in Google Analytics
ID:
Backlog
Published on 11/20/2018
•
Last update on 12/22/2022
Summary
Transactions are recorded in Google Analytics based on the confirmed order page (orderPlaced). When the customer reaches the page an event is sent to the Data Layer, so Google Tag Manager captures this event and triggers the Google Analytics script.
If the customer visits this page over and over again, or even if they reload/update the page, the event is triggered and the data is re-sent to Google Analytics, creating repeated information.
Simulation
- Complete an purchase in the store;
- Access the placed order page repeatedly;
- Note that these multiple hits have been recorded as completed orders in Google Analytics.
Workaround
There is no workaround for this type of integration.
One possibility is to avoid integrating frontend transactions with GTM/Javascript. Instead, work with a backend integration (middleware) between VTEX order APIs and the Google Analytics transaction APIs.