我正在尝试将自定义变量添加到分析中,以跟踪我的用户的客户组和子组 表示。
我的网页浏览量显示在Google Analytics中,但没有自定义视频。
编辑:原来的秘密是等待两周让Google为您创建自定义变量插槽。数据在最终创建插槽后立即显示出来。
这是我的代码:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'REDACTED]);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setCustomVar', 1 , 'Community', 'REDACTED', 1]);
_gaq.push(['_setCustomVar', 2 , 'SubCommunity', 'REDACTED', 1]);
_gaq.push(['_trackPageview', 'User_Login']);
_gaq.push(['_trackTrans']);
(function () {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})()
</script>
有什么建议吗?