title: Test Google Analytics on Localhost
body: <p>I need to test some custom firing events using Google Analytics. I'd like to test in a local environment. </p>
  
  <p>I've set up my test site using apache with server name: <code>my-ga-test.localhost/</code></p>
  
  <p>According to <a href="https://stackoverflow.com/questions/4375447/can-you-test-google-analytics-on-a-localhost-address">Can you test google analytics on a localhost address?</a> and <a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced" rel="noreferrer">Google Analytics docs</a>, I'm able to adjust my GA code to use:</p>
  
  <pre><code>ga('create', 'UA-XXXX-Y', {
    'cookieDomain': 'none'
  });
  </code></pre>
  
  <p>I tried to set up a new account to get a tracking ID for this site, but I'm getting the following error:</p>
  
  <blockquote>
    <p>URL ends with an invalid top-level domain name</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/Xt93W.png" alt="enter image description here"></p>
  
  <p>How do I generate the code using localhost domain so I can alter the tracking ID code to put on my localhost?</p>