2014-01-10 58 views
0

我使用谷歌Analytics(分析)在我的網站,但得到Chrome的錯誤,說:谷歌分析錯誤的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> 

有誰知道一個想法有什麼不對?

+0

這看起來不像是一個錯誤。 – putvande

+0

嗯,但Chrome會在Google Analytics本身的錯誤分類中顯示它... – Jan

+0

?當您訪問包含此代碼的頁面時,不是這樣嗎? – putvande

回答

0

我昨天在我的WordPress博客中實現了GA代碼,並且我得到了同樣的錯誤。我搜索了很長時間,我無法解決問題。

不過,我終於實現了代碼只是HEAD標籤http://screencast.com/t/Bh5L9x3Nk8 結束之前我什麼都不做,現在(在幾個小時後)GA似乎做工精細和實時工具註冊活動http://screencast.com/t/lI1eJzduJ7iR

乾杯, Jose

相關問題