我正在尝试在 Google Analytics 中获取 setAllowAnchor 标志来记录活动信息,但它似乎不起作用。
我尝试使用它的网站使用 hashbang 样式的 URL 顺便说一句 - 这http://hostname/#!/relative-url
是导航样式,因为需要有一个跨页面视图的持久音频播放器。
我已经尝试了以下两种方法,但setAllowAnchor
在 GA 中没有看到任何广告系列。
/#!/&utm_campaign=setAllowAnchor&utm_medium=hash&utm_source=test
/#utm_campaign=setAllowAnchor&utm_medium=hash&utm_source=test
不推荐使用 setAllowAnchor 函数。我究竟做错了什么?
我的 Google Analytics 代码如下所示:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1060190-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_trackPageLoadTime']);
_gaq.push(['_setAllowAnchor', true]);
(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>