Mal*_*lio 10 google-analytics content-experiments
我正在使用Javascript API进行Google Analytics内容实验,看起来您有两种选择:
chooseVariation(),或者setChosenVariation()(1)让Google控制分配给每个变体的用户数量,这是我需要的,但我有几个实验.这似乎很基本.我错过了什么?
nt_*_*t_1 19
我不认为你错过任何东西.我的理解是,GA Experiments API允许您使用Choose Variation命令为任何版本的单个A/B/N测试分配访问者:
cxApi.chooseVariation();
Run Code Online (Sandbox Code Playgroud)
但是,只有在页面上加载api.js时指定实验ID时,此功能才可用.
如果您想要做的是同时在一个页面上运行多个A/B测试,这实际上是多变量测试,不幸的是,这在GA内容实验中不具备"开箱即用"功能(它曾用于Google网站优化工具).您仍然可以使用自己的分组"伪造"它,代码如下:
<!-- 1. Load the Content Experiments JavaScript Client -->
<script src="//www.google-analytics.com/cx/api.js"></script>
<!-- 2. See if the visitor has seen an experiment already -->
<script>
// loop through all active experiments server-side.
cxApi.getChosenVariation(
$experimentId
);
<!-- 3. Bucket the visitor if he isn't bucketed already -->
// loop through your live experiments
cxApi.setChosenVariation(
$chosenVariation, // The index of the variation shown to the visitor
$experimentId // The id of the experiment the user has been exposed to
);
</script>
Run Code Online (Sandbox Code Playgroud)
您需要决定是否希望访问者一次只能查看一个实验或同时进入多个实验.
第一个选项可能更可靠,但意味着您必须在很多桶中拆分访问者,这意味着您的测试将在返回结果之前花费很长时间.
如果您使用第二个选项,则需要注意:如果您的实验不是独立的,那么您将无法信任Google Analytics的测试结果,因为内容实验中使用的统计测试会假设独立性.即使您的实验是独立的,您也需要在所有变异组合中进行相等的分割.
我希望有所帮助!
| 归档时间: |
|
| 查看次数: |
5431 次 |
| 最近记录: |