I have a development environment for a website. The environment is an exact clone of the production side, so it's going to have google analytics on it. What's a good way to exclude traffic?

I tried google analytics filters but I think i'm missing something.

Here's what I tried:

Filters > Predefined
 - Exclude | traffic from the domains | that are equal to, that contain
 - sub.mydomain.com

Filters > Custom
 - Exclude | Hostname
 - Filter Pattern: ^sub\.mydomain\.com

Anyone have any suggestions?

  • 1
    If you have a condition that looks up the host name, you could have the same code on both production and dev, but on dev you wouldnt display GA code. (PHP: if ($_SERVER['HTTP_HOST'] != 'dev.mysite.com') printGACode();)
    – milo5b
    Aug 15, 2012 at 18:25

1 Answer 1


Assuming only a handful of people are going to see the development site you could exclude the IP addresses of those that will visit it. You may still have someone test something on an IP not included but that should get rid of most of the unwanted data, as well as help keep your data from being skewed by you on the live site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.