Universal Analytics Transaction Discrepancy
I've set up Optimizely Universal Analytics and ran an experiment, but I'm getting very disparate numbers for total number of transactions between Google Analytics and Optimizely.
Optimizely - Total Transactions
Control - 793 transactions
Variation - 782 transactions
a ~1% loss in total transactions
Control - 708 transactions
Variation - 671 transactions
a ~5% loss in total transactions
The code to record a transaction are right next to eachother on the receipt page and surrounded by a test to ensure the customer just purchased and not reviewing a receipt.
I've looked for any possible reason for this discrepancy, but am unable to pinpoint it. It's such a large difference that something must not be correct here. I've looked through the Troubleshooting: Analytics discrepancies, Google Analytics and Universal Analytics, but don't see anything incorrect that I've done.
Could someone help me determine the cause?
Solved! Go to Solution.
That is... if I refresh the order confirmation page, Optimizely would record a second conversion whereas GA may de-duplicate it since it sees that it has already recorded that order id.
Analytics and Testing Guru
Refreshing the page should not cause the transaction to be sent to GA, nor optimizely. We've tested this scenario.
I created a report in GA to view all Transaction IDs and see if any were duplicated and only one transactionID that was reported twice. Every other transaction was only recorded once. So I can tell that GA isn't de-duplicating transactions.
I opened a ticket and after back and forth we resolved the issue. The discrepancy came from the fact that my custom dimension in GA was set to session scope and not user scope. Optimizely tracks users with a 10 year cookie. So, if a user sees an experiment, but decides not purchase until the next day, optimizely will count this as a conversion. Whether or not GA will have the custom dimension marked for this purchase depends on a few factors.
Optimizely only sets the GA custom dimension on pages specified in the editor settings' URL Targeting. So, if a customer returns to the site after the GA session has expired (see How a session is defined in Analytics for more details), but doesn't visit a URL Targeted page, the GA custom dimension will NOT be set.
So, you have 2 options
- A customer who completes a purchase within a GA session (SESSION SCOPE)
- A customer who were included in the variation who complete a purchase eventually (USER SCOPE)
If you decide to use a user scope for your custom dimension you have to realize that if a user who was involved in the first experiment becomes involved in a second experiment, then all future purchases will count towards the second experiment and not the first.
Essentially, Optimizely dimensions are set on URL Targeted pages only. If you use a user scope then any goals made anytime in the future will count towards a conversion for that goal, until the user encounters a new experiment. Whereas, a session scoped custom dimension will only count as long as the goal is activated within a GA session (30 minutes of inactivity or a day change).