Analytics 添加允许锚点到 JS
我想将我的广告系列跟踪设置为允许 # 而不是 ?使用 _setAllowAnchor(true)
然而,我还没有找到一个看起来很像我的 GA javascript 的例子(来自 html5boilerplate)。我如何将 add _setAllowAnchor(true) 添加到下面的 javascript 中?
<script>
var _gaq = [['_setAccount', 'UA-XXXXXX-X'], ['_trackPageview']];
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
})(document, 'script');
</script>
提前致谢。
I would like to set my campaign tracking to allow # instead of ? using _setAllowAnchor(true)
However, I have yet to find an example of the GA javascript that looks quite like mine (from html5boilerplate). How would I add add _setAllowAnchor(true) to the below javascript?
<script>
var _gaq = [['_setAccount', 'UA-XXXXXX-X'], ['_trackPageview']];
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.async = true;
g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s.parentNode.insertBefore(g, s);
})(document, 'script');
</script>
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里要注意的主要事情是它需要出现在 _trackPageview 之前,因为这是代码的实际触发器。
The main thing to note here is that it needs to come before the _trackPageview, as that is the actual trigger for the code.