user135596
user135596

Reputation:

Why is the google analytics javascript file not loading?

I have the Google Analytics (admin/config/system/googleanalytics) module on my site. When I go to my site, I get an error message in the console:

Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://www.google-analytics.com/analytics.js 

Even when I go into my Google Analytics account, they give me the following code to put in:

<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','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-myid-4', 'auto');
  ga('send', 'pageview');

</script>

If I try to go to that url, it says "This webpage is not available".

Upvotes: 2

Views: 1504

Answers (1)

user135596
user135596

Reputation:

Turns out I had it blocked in my host file.

Upvotes: 5

Related Questions