I am trying to use Google Analytics on my site. I copied the code directly from the Google Analytics website and followed the instructions for embedding it in my HTML.
Here is my code:
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','not giving this out');ga('send','pageview');
</script>
When I load my page with this script, it takes a few seconds. Without a script, it loads almost instantly. This is how I know the problem is with the Google Analytics code.
After the page loads, the following error message appears:
Failed to load resource: net::ERR_FILE_NOT_FOUND
After some further investigation, the file was not found from e.src='//www.google-analytics.com/analytics.js'on line 5.
How can I make this file or script work correctly?
source
share