Google Universal Analytics Localhost Setup

partizan picture partizan · Nov 13, 2013 · Viewed 7.9k times · Source

I'm trying to test GA on localhost after following the suggestions in Can you test google analytics on a localhost address?

1). but I don't see any data being send to my Google Analytics account when browsing on my localhost server and calling the JS script. I know it's executing the JS. What am I doing wrong? Here is my JS code:

(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-55555555-1', {
  'cookieDomain': 'none'
});

ga('send', 'timing', 'jQuery', 'Load Some Test Library', 20, 'Google Test');

2). Also, I'm confused about GA requiring a default domain to be set under Admin --> Property --> Property Settings. If I declare 'cookieDomain':'none', does that mean the domain as part of my GA account is ignored?

Cheers,

partizan

Answer