cxApi.chooseVariation() always returning 0
问题 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