簡體   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