Reputation: 666
We have a server side experiment running through our own implementation.
We started with Google Optimize to keep track of the experiment through their server side experiments-solution but some tracking seems to be off for us (not so standard setup). Now we want to test whether the problem is with our Optimize implementation.
What we would like to do is fill the experimentId and experimentVariant in the fieldsObject without using the implementation with Google Optimize.
We're using Tag manager for our GA implementation and while debugging we do see that the experimentId ("expId") and experimentVariant ("expVar") are being set but for some reason it's not being picked up by GA in our reports.
This is what I see in the GA Debugger for the other variant, this seems fine:
Is it possible to set expId and expVar in GA fieldsObject without using Google Optimize? If so, how and how do I see them in my reports?
Upvotes: 2
Views: 2268
Reputation: 538
If you are using GTM to also deploy the Universal Analytics tag - your tracker would not have the default tracker name.
Thus, the code ga('set', 'exp', '{expId}.{expVar}')
(which implicitly assumed a default named tracker) would not set the fields on the tracker it should.
Instead, use the Optimize GTM tag, and fire it right before you fire the UA "Page View" tag - and set the ExpVar and ExpID explicitly as fields on the UA tag. (get those values from JS vars, DL or cookies for example, after the server decided which variant and experiment the user should be bucketed to). See these questions:
Google Tag Manager & Optimize Server-Side experiment sending variation
How can I set Analytics variables with Google Tag Manager from the server?
Upvotes: 3