2

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.

Fieldsobject is being sent with every pageview

This is what I see in the GA Debugger for the other variant, this seems fine: enter image description here

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?

Iggy van Lith
  • 606
  • 1
  • 7
  • 16
  • Just to confirm, you're using the server side implementation of Google Optimize? Not the JS client-side version? – XTOTHEL Oct 25 '18 at 13:25
  • Well yes. Server side just means implementing the ga('set', 'exp', '{expId}.{expVar}') in the html and then the optimize js picks that up as the variant to set. So optimize still does the tracking but not setting the variant for the user. – Iggy van Lith Oct 29 '18 at 08:34

1 Answers1

3

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?

Yoad Snapir
  • 528
  • 2
  • 10