title: How to fix Google Analytics "analytics.js" net::ERR_FILE_NOT_FOUND?
body: <p>The relevant line of the Google script is:</p>
  
  <pre><code>(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  </code></pre>
  
  <p>I am running this particular file locally (as in, I double-click "index.html" on Windows Explorer and it opens in Chrome.</p>
  
  <p>After about a minute of trying to load this file it fails with <code>net::ERR_FILE_NOT_FOUND</code> reported in the Developer Console.</p>
  
  <p>I understand why this is happening, it is trying to load this as a local file.  If I do this it works just fine:</p>
  
  <pre><code>(window,document,'script','www.google-analytics.com/analytics.js','ga');
  </code></pre>
  
  <p>In other words, I eliminated the <code>//</code>.  This would work just as well:</p>
  
  <pre><code>(window,document,'script','http://www.google-analytics.com/analytics.js','ga');
  </code></pre>
  
  <p>Is going explicitly doing it this way to only track real websites?  </p>
  
  <p>If so, how are you dealing with this issue for local development?</p>
  
  <p>I do run a VM with Ubuntu server for local development of more elaborate sites.  In this case I was working on a single file landing page that I knocked out quickly and wanted to just test just as easily but ran into the browser hanging waiting for <code>analytics.js</code></p>
  
  <p>Is it safe to remove the <code>//</code> or add <code>http:</code> in general terms.  I don't generally like to modify Google code unless I fully understand why they are doing things in a specific way and what the consequences of my actions might be.</p>