繁体   English   中英

Chrome浏览器中的Google Analytics(分析)错误

[英]Google Analytics Error in Chrome Browser

我在我的网站上使用Google Analytics(分析),但在Chrome中看到错误消息:

GET http://www.google-analytics.com/analytics.js
(anonymous function)
(anonymous function)

我的嵌入代码是这样的:

<script>
var gaProperty = 'UA-XXXX';
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) {
  window[disableStr] = true;
}
function gaOptout() {
  document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
  window[disableStr] = true;
}
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXX', 'website.com');
  ga('set', 'anonymizeIp', true);
  ga('send', 'pageview');
</script>

有人知道出什么事了吗?

我昨天在WordPress博客中实现了GA代码,但遇到了同样的错误。 我用谷歌搜索了很长时间,我无法解决这个问题。

但是,我终于在HEAD标签http://screencast.com/t/Bh5L9x3Nk8结束之前实现了代码,现在什么也没做,而现在(几个小时后)GA似乎可以正常工作,并且它的实时工具正在注册活动http: //screencast.com/t/lI1eJzduJ7iR

干杯,何塞

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM