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>
有誰知道一個想法有什麼不對?
這看起來不像是一個錯誤。 – putvande
嗯,但Chrome會在Google Analytics本身的錯誤分類中顯示它... – Jan
?當您訪問包含此代碼的頁面時,不是這樣嗎? – putvande