Editor's note:
Thanks for visiting GA Tip of the Day. Please see current posts on the Cardinal Path blog.

Apply a Hostname Filter for Development and Staging Servers

Hostname filterview at full size

You can apply define a filter based that limits profile data to a specific hostname.

If is likely that your Google Analytics tracking code resides, along with everything else that constitutes your website, on a development or testing/staging server before you deploy it to your production server.

To include or exclude Google Analytics data that is generated on any server, you can apply a profile filter that specifies the exact version of your domain, such as:


For profiles that should contain production data only, a best practice is to apply an include filter for your production domain only:


As a general note, once you define an include filter for hostname (or any other dimension), all other versions of the hostname will be excluded, so there’s no need to apply a hostname include and an exclude filter to the same profile.

Also note above that the \ serves as the regular expression “escape” character so the dot is interpreted as a literal dot and not as a wildcard match single character.

Please share this post:
Facebook Twitter Plusone Linkedin Email

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>