Articles in The 'include filter' Tag

June 8 2011

How to exclude an IPv6 address from your Google Analytics profile data

by MoreVisibility

Today is the World IPv6 Day, and every major Internet player is involved.

Essentially, the Internet is running out of connection space. The way that we connect our computers, our laptops and our mobile devices to get on to the internet is made possible by an IP address that we are assigned as we attempt to log-on and surf the web for work, for pleasure, or both.

The world is running out of IP addresses. Today, June 8, 2011, is the first world-wide scheduled test flight of an improved and enhanced method that will provide over 4 billion times more space than what we have available to us through IP addresses. This method is known as IPv6, and its successful global deployment will make it possible for every man, woman, and child in every country on every continent on Earth to access the internet.

How this process works, and a little background

Have you ever heard of the Internet Assigned Numbers Authority (IANA)? I’d bet that you probably haven’t. They have one of the most difficult and responsibility-laced jobs in the world: it’s up to the IANA to manage global IP address space allocation. Basically, every IP address in the world is tied back to the IANA.

The IANA works with five regional internet registries (known as RIR’s) to distribute blocks of these IP addresses to local registrars and internet service providers (the company that you pay for internet service).

The IANA is operated by the Internet Corporation for Assigned Numbers and Names (known as ICANN, which you may have heard of before).

So, a possible hierarchy of how an IP address eventually gets assigned to you could look something like this:

—–> RIR
———->Your ISP
—————> Your Company
———————> Your computer / laptop / mobile device

A traditional IP address vs. an IPv6 address

A traditional IP address is something that looks like this:

This is the traditional IP address (an IPv4 address, to be exact). There are four octets (parts) in an IPv4 address, and each octet must be between 1 and 255. As you can imagine, this means that there are a limited number of combinations possible – 232 (4,294,967,296) addresses to be exact!

Two to the thirty-second power sounds like it’s a lot, but the truth of the matter is that we are very close to reaching that number.

An IPv6 address will look like this:


Each IPv4 (traditional) address is 32 bits in size (232). An IPv6 address is 128 bits in size, which means IPv6 allows for approximately 340 undecillion addresses (2128). Yes, two to the one hundred and twenty-eight power. That’s definitely more than you can shake a stick at!

Excluding your IPv4 or IPv6 address from your Google Analytics profile data

At MoreVisibility, we feel that one of the ways that we can lend a hand is by showing you how to exclude your IP address (IPv4 or IPv6) from your Google Analytics profile data. It may be that you never are assigned an IPv6 address, or it may be that it takes years for you to get one, so the goal of this blog post is to serve as both a message in a bottle, as well as something you can do today with your traditional IPv4 address.

Let’s start excluding your own traffic from your reports!

Step-by-Step Guide:

1. Log-in to your Google Analytics account.
2. Ensure you have Administrative Access to your Google Analytics account.
3. Ensure that you are using the new version of Google Analytics.
4. Select the appropriate web property / profile that you wish to apply this filter to.
5. Click on the Filters tab.
6. Click on + New Filter.
7. Ensure that you’re creating a new filter, not choosing from an existing filter.
8. Give your filter a name and keep Predefined filter as the filter type.
9. Change the middle of the three drop-down menus to traffic from the IP addresses.
10. At this point, stop what you’re doing for now.
11. Open a new browser tab or window and visit (or, search for “what is my IPv6 address” on Google and select from a large sampling of websites that will check your IP address).
12. Copy and paste the IP address that is returned to you, and paste it in the IP address form fields back in your Google Analytics account where you just left off.
13. If you checked your IP address and it’s an IPv4 address, place each octet, in order, in the four boxes that you will see. If you checked your IP address and it’s an IPv6 address, check the IPv6 check-box first, and then paste in your IP address into the long form field.
14. Click on Save at the bottom of the page, and you’re done!

Filters in Google Analytics can take approximately 24 hours to activate, so give your new filter about a day or so to start working.


* Sources for this blog post: Wikipedia (IPv6) and the World IPv6 day website.

April 7 2011

Clean up your Google Analytics data with these 5 filters

by MoreVisibility

Attention all Google Analytics users around the world: you don’t have to be an expert in regular expressions to use filters. Why? Because this post will help you, that’s why!

No long and drawn-out lead-in to the story this time – here are 5 filters that you can create for your Google Analytics profile(s) that will tidy up your data and make you a happier analyst.

1. Excluding your own traffic from reports
Why: Chances are that your own visits to your own web site aren’t racking up that many visits and page views. Nonetheless, you can still permanently remove your own traffic statistics from appearing in your Google Analytics profile(s).
How: First, grab your IP address from (or, ask an IT person). If you have administrative access to your account, click on your account’s name, then click on your web property’s name. Next, click on the filters sub-tab (within the profiles tab), click on “Add Filter“, and do the following:

Method: Create New Filter
Filter Name: Exclude my IP Address
Filter Type: Custom Filter >> Exclude
Filter Field: Visitor IP Address
Filter Pattern: ^$
Case Sensitive: No

Replace the IP address in the example above with your own IP address, but leave the ^, the $, and the three symbols (just replace the numbers). Click Save, and you’re done!

2. Lowercasing your hostnames
Why: A hostname is a domain that has sent you visitor data. In other words, a hostname is a URL where your Google Analytics tracking code is present and has at least sent you 1 visit during the selected date-range that you’re looking at. If you ever toggle your report dimension by hostname, or switch the viewing table to show hostnames, you could see mixed cases (upper and lower), which leads to many different variations of your same domain name appearing. That also means you need to work on your SEO re-directs – but that’s something for another time.
How: Go through the same steps as you did in the last filter to get to the filter creation screen. Once there, do this:

Method: Create New Filter
Filter Name: Lowercase Hostnames
Filter Type: Custom Filter >> Lowercase
Filter Field: Hostname

Click Save, and you’re done! You can also create additional lowercase filters to do the same thing to other pieces of data that may look unsightly (one of them might be the Request URI filter field, which represents everything after the .com part of your URL).

3. Search for long, bulky page name; Replace with short, clean page name.
Why: Page names can get long and bulky. There’s probably an important page in your top ten that’s just an eye-sore. How about we shorten it and clean it up some?
How: Follow these filter creation steps – but remember to change the page names to your own, as the following is just an example:

Method: Create New Filter
Filter Name: Search & Replace: Long page with “/john.php”
Filter Type: Custom Filter >> Search and Replace
Filter Field: Request URI
Search String: /your-very-long-and-bulky-page.php?id=1234567
Replace String: /john.php
Case Sensitive: No

4. Add the visitor’s browser to the visitor’s operating system
Why: Why not? Google Analytics lets you create some powerful, advanced filters that let you do something cool (and efficient) like adding the visitor’s browser to the operating system that they’re using. This way, you can see a visitor’s browser along side a visitor’s operating system, without having to apply a secondary dimension (saving your secondary dimension option for something else).
How: Here’s how you do it:

Method: Create New Filter
Filter Name: Operating System + Browser Platform
Filter Type: Custom Filter >> Advanced
Field A -> Extract A: Visitor Operating System Platform -> (.*)
Field B -> Extract B: Visitor Browser Program -> (.*)
Output To -> Constructor: Visitor Operating System Platform -> $A1 – $B1
Field A Required: Yes
Field B Required: No
Override Output Field: Yes
Case Sensitive: No

For Field A and Field B, choose the filter field as described, and then in the blank form field, type in (.*) as shown.

5. Include your domain (and, ONLY your domain!)
Why: Unfortunately, server caching and having your tracking code outright stolen and placed on someone else’s web site is something that we sometimes have to deal with. So, from time to time, you must write a filter that will prohibit the collection of data from every domain except for your own web site.
How: Create your include filter like this:

Method: Create New Filter
Filter Name: Include my domain
Filter Type: Custom Filter >> Include
Filter Field: Hostname
Filter Pattern:$
Case Sensitive: No

Click Save to stop the nefarious ones from sending you irrelevant data!

We could write about filters until the next Presidential election, because there is just so much on the topic, and, so many different things that you can do with filters. Even though you can copy the steps outlined in the above 5 filters directly, I still urge you to use caution. Filters are sensitive, temperamental, and must be precise, to say the very least. A poorly-created filter can cause permanent damage, so tread lightly.

What about you? What filters do you like to use? What problems are you experiencing? We’d love to hear your thoughts below!

© 2023 MoreVisibility. All rights reserved.