没有重定向的谷歌分析内容实验没有访问者 [英] google analytics content experiment without redirect getting no visitors
问题描述
我已经实现了一个没有重定向的 GA 实验
I have implemented a GA experiment with no redirect
<script type="text/javascript">_udn = 'example.com'; _uhash='off';</script>
<script type="text/javascript" src="//www.google-analytics.com/cx/api.js?experiment=ExperimentID"></script>
<script type="text/javascript">var chosenVariation = cxApi.chooseVariation();</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'AccountID']);
_gaq.push(['_setDomainName', 'example.com']);
_gaq.push(['_setAllowHash', false]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
我似乎没有得到任何访问.我遵循的说明在这里experiments-client-side
I don't seem to get any visits. The instructions I followed are here experiments-client-side
我已按照此类似问题
Google 似乎仍然没有收到我的实验访问.
Google still does not seem to be receiving my experiment visits.
我想知道这是否与使用 stats.g.doubleclick.net/dc.js 而不是 ga.js
I am wondering if it has something to do with using stats.g.doubleclick.net/dc.js instead of ga.js
推荐答案
将 ga.src 更改为 ga.js 实验似乎不适用于 stats.g.doubleclick.net/dc.js
Change the ga.src to ga.js experiments don't seem to work with stats.g.doubleclick.net/dc.js
ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
改为
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
此解决方案不是最佳解决方案,因为它阻止我获取人口统计数据,但我现在至少正在获取实验数据.
This solution is not optimal since it stops me from getting demographic data but I am at least getting experiment data now.
这篇关于没有重定向的谷歌分析内容实验没有访问者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!