Category Archives: Filters

Filters for Subdomains and Hostnames

Separate Profiles for Separate Subdomains

You can also filter based on subdomains. Let’s say that there’s a part of your site that you want to track separately from the rest. Maybe it’s a blog, or maybe it’s a section that only receives traffic from your email marketing.  Or, for example, it may be a members-only part of the site – members.yoursite.com. To track the members-only section of the site separately, you could create a separate google analytics profile and then set up two filters – one in a “regular” profile and one in your members-only profile.

In your regular profile, you would set up the following filter:

Exclude – subdomain – members.yoursite.com

include-subdomain-filter

In the new members-only profile, you would set up the opposite filter:

Include – subdomain – members.yoursite.com

exclude-subdomain-filter

Don’t count  the posers – excluding hostnames

I know it’s not nice, but sometimes  people steal content. And when they do, sometimes they’re really sloppy about it, and copy your Google Analytics code along with it. When this happens, visits to the poser’s site will show up in your Google Analytics tracking –  unless you filter them out.

Now here’s the thing – I don’t necessarily recommend filtering out all hostnames besides your own. Sometimes other hostnames represent legitimate traffic that you  might be interested in tracking. If someone uses Google Translator to translate your page, for example, their session will be attributed to the translator tool hostname. I might think that that’s pretty cool, and want to count those visitors. Even if you decide you’re not interested in counting these sorts of visits and only want to count actual visits to your hostname in your reporting, I recommend that you set up a separate profile that records everything so that you can keep tabs on traffic from other hostnames and identify posers that are stealing your content.  (Another alternative is to only exclude hostnames as you discover them and determine them to be illegitimate).

Stop Taking Selfies!

How to use filters to exclude internal traffic from reporting

Yes, you. Stop taking pictures of yourself. I know you might not mean to, but see, that picture there? Yeah, that one. We see your reflection in the window. Kind of ruins it.

What I’m talking about, is the problem of showing your own visits to your site in Google Analytics. Because let’s face it, compared to every other visitor of your site you and most other people that work on your site or at your company are weird stalkers with totally erratic, outlier behavior that shouldn’t be factoring into your web analytics.

This is super obvious if you’ve started a site by yourself. If you have, my experience with the first iteration of anyalamb.com might sound familiar.

The very first time I used Google Analytics was for the first iteration of this site about a year and a half ago. I had written a handful of posts and wanted to look in Google Analytics to see if they’d gotten any traffic. Unsurprisingly, they hadn’t gotten much – I saw several dozen visits from one user, and a handful of other uniques – mostly spam and close friends I’d send links to. I immediately realized that all or most of the returning visits must be mine. “There’s got to be some good way to filter this stuff out!”, I thought.

It turns out that there is a very quick and easy way to filter out your own traffic – and certain other types of traffic you might not want to include in your reporting.  Here’s how it works:

Filtering out an IP address

Click on “Admin” and then click on “Filters”. Name your filter so you can easily keep track of what you’re excluding from your Analytics reporting and why. For example, if you want to create a filter to exclude all IP addresses from your company headquarters, you might label it “Internal Widgets, Inc. IP Addresses”. If I want to exclude traffic from hy home IP address, I might name my filter “Anya’s home ip”.

filter out own traffic

To simply filter out individual IP addresses, you can leave “predefined filter” selected. Then “exclude” from the first dropdown menu and “IP address” from the second. Then simply fill in the IP address you want to exclude. It’s that easy.

(Don’t know your IP address? If you’re dealing with multiple IP addresses, you can ask IT directly. If you’re just trying to exclude the IP address you’re currently using, check www.whatismyip.com – and yes, you could have just googled that. )

Once you do this, traffic from this IP address will not appear on your google Analytics reports. And guess what? It works retro-actively too. Traffic from the filtered IP address will be excluded from reports even for dates prior to the implementation of the filter.

Why it’s important

Setting up filters is so quick and easy and obviously good for data quality that it doesn’t require much justification. But just in case you’re curious, here are a couple of other reasons I’m a fan of filtering out your internal traffic.

Now if you’ve got a lot of volume on your site, excluding your own visits might not seem very important – they might be a drop in the bucket and when you take a high-level look at things, they might not seem to interfere with your analytics very much. And this may very well be true – most of the time. However, those self-visits tend to be visible in high-profile places.

Say, for example, that you’ve created a new landing page and you’ve distributed it for internal review but haven’t started sending ad traffic to it yet. That page might garner a lot of “internal” traffic that might distort your analytics once the page actually starts receiving traffic.

It also might cause some confusion around when the page actually “launched”. If you filter out the internal traffic, you’ll only start reporting data for the page when the page actually starts receiving external traffic, and there will be a nice clear indication in your visit data of when that happened. Ideally, you’ll add an annotation to your Google Analytics timeline when that happens anyway, but just in case you forget, you’ll have an easy way to look it up.

What other IP addresses should you exclude?

Remember – yours might not be the only IP address you might want to filter out. Are there contractors that work on your site? Make sure you filter them out too. What about other office locations? Ditto. And of course, don’t forget to update your filters when you move offices or otherwise change or add internal IP addresses.

Don’t forget (friendly) bots!

If you’re intentially running a bot on your site, such as StillAlive, you’ll want to exclude it too, usually by IP address.

What if you’re using dynamic IP addresses?

That’s ok. You can still filter out internal traffic from dynamic IP addresses, but instead of using the IP address to filter, you will use a cookie. Lunametrics has a great post about how you can use cookies to label your internal traffic.

Learn about more cool things you can do with filters