views:

250

answers:

2

Is there any Google Analytics testing/sandbox environment for testing your JS custom code before putting it to live system?

I don't want to use my real tracking ID to see if everything is correct on my dev. environment, neither I want to put my code untested live...

Is there any techniques or maybe some fake Analytics tracking lib I could use for testing?

+1  A: 

I believe it is possible, but you have to tell it to not use the domain when setting the cookie...

var pageTracker = _gat._getTracker("UA-12345-1");
pageTracker._setDomainName("none");
pageTracker._trackPageview();

And you probably have to use a legitimate tracker ID.

Also, be sure to see Analytics Customizations: Using a Local Server

Josh Stodola
Thanks! Local Server customization did the trick
Laimoncijus
A: 

Why don't you just create a new tracking code / profile in GA? That way you can see the results on your dev server and then switch to the real tracking number when you move to live.

David Radcliffe