Not seeing UA dimension added
So we're trying to add Universal analytics to our testing.
The snippet is called first.
The optimizely code is inserted immediately before the ga('send') action. Almost immediately after the snippet call.
This all happens in the header.
Using the ga.debug plugin for Chrome, I'm not seeing the dimension being added. Nor is it showing up in my ga dashboard.
I've tried setting a new dimension and overwriting an old one - neither seems to work.
I AM testing this locally, but the rest of the variation works - why not this part?
Solved! Go to Solution.
Just to double-check, did you enable UA in the "Options" of the experiment? It should be enabled and the right dimension specified in addition to the code you added in order for it to work.
gaq('set', 'dimension10', "Variation #1"]);
Optimizely doesn't require a connection to the google server, you're right in that it just adds a value to the gaq or ga object. You mentioned your script redefines ga - does it check to see if ga exists first? With something like this:
var _gaq = _gaq || ;
If it doesn't, it might be overwriting the custom dimension that Optimizely had set.
No, and it shouldn't need to. Besides, I immediately added that I've checked it with the debug on and off...and it doesn't work either way.
In the source it looks like this:
Everything appears to be in order, my debug and Google Analytics show all our other dimensions getting passed, but the variation is not.
Is the experiment running? If the experiment you're looking for isn't running, then it won't show up at all.
What should happen is that the optimizely.push('activateUniversalAnalytics') push will take the experiment data, if available, and push that to the GA Dimension value you set in the experiment options.
A couple things to do:
1. Confirm the experiment is alive by running "optimizely.activeExperiments" in the console?
2. Look at the GA debug console printout and see if there's a ga('set', 'dimension10', 'Variation###'). If there is, then it's working but something is not lining up. If there isn't, then it isn't getting run at all
Also, just wanted to point out since you had it circled as well, that 3rd line in your code with 'setDimensionValue' is for an Optimizely Dimension, which is used for dimensions within Optimizely, and doesn't have anything to do with Google Analytics.