Google Analytics - Failed to load resource: http://www.google-analytics.com/ga.js
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 it's an offline app (ie, you've defined a cache manifest) be sure to allow the network request.
See HTML5 Appcache causing problems with Google Analytics