1

我执行以下操作 - (XXXXX代表我的实验 ID),如此处所述 - https://developers.google.com/analytics/devguides/collection/gajs/experiments#cxjs-load

<!-- Google analytics Experiment-->
        <script src="//www.google-analytics.com/cx/api.js?experiment=XXXXX"></script> 

<script>
   var variationExperiment = cxApi.chooseVariation('XXXXX');
   cxApi.setChosenVariation(variationExperiment,'XXXXX');
   console.log(variationExperiment); // gives 0 or 1 according the google decision
   console.log(cxApi.getChosenVariation('XXXXX')); // always returns -1 , mean cxApi.NO_CHOSEN_VARIATION
</script>

console.log(cxApi.getChosenVariation('XXXXX'))-1即使我以前做过也只会回来cxApi.setChosenVariation(variationExperiment,'XXXXX')

它是什么指示?我的谷歌分析加载是否成功?

4

1 回答 1

0

chooseVariation 不允许任何参数。它使用脚本加载的实验。

https://developers.google.com/analytics/devguides/collection/gajs/experiments#cxjs-choose

于 2016-04-07T21:19:55.160 回答