My site is a single page webapp. I'm loading the experiment code with my experiment id:
<script src="//www.google-analytics.com/cx/api.js?experiment={@ js_settings.analytics.experimentid @}"></script>
After all is loaded, at the moment I display the page, I select the right template by calling a function which does the following:
ga('set', 'expId', experiment_id);
var variation = cxApi.getChosenVariation(experiment_id) || cxApi.chooseVariation();
cxApi.setChosenVariation(variation, experiment_id);
ga('set', 'expVar', variation);
ga('set', 'dimension1', variation);
ga('send', 'pageview');
Now, it seems like cxApi.chooseVariation()
always returns 0. 100% of the 205 sessions so far were given the default variation (0). Why?