I've been noticing this error on Chrome's console for a while now:
I modified Google's script so that it logs the error, because it uses try{} catch{}
, and this is what I got:
I haven't noticed considerable changes in the stats, it's always in ups and downs.
Also, this isn't only on my sites, but fricking everywhere. I haven't found bug reports or anything like that.
If I go to http://www.google-analytics.com/ga.js on the browser, it loads normally.
Does anyone have a clue of what causes this?
It was a problem with AdBlock. I disabled it and now it loads it normally.
yagudaev suggests (read answers below) that in order to keep AdBlock from blocking Google Analytics, you need to edit the snippet provided and explicitly use https://
instead of the protocol-relative URL by default. This means changing
'//www.google-analytics.com/analytics.js'
into
'https://www.google-analytics.com/analytics.js'
Example:
<script> (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','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXX-XX', 'auto'); ga('send', 'pageview'); </script>
It could also be your hosts file, here's mine:
$ grep -ni "google-analytics.com" /etc/hosts 6203:# 127.0.0.1 ssl.google-analytics.com #[disabled = Firefox issues] 6204:127.0.0.1 www.google-analytics.com #[Google Analytics]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With