If you are using Google Analytics for web analytics it can be beneficial to exclude certain addresses to provide a more accurate view of traffic to the site. There are numerous reasons that excluding IP’s from the analytics statistics such as if it is a personal site that doesn’t do a lot of traffic and you are working on all the time from home the analytics results might not provide a real world view of what other visitors view the most. Another example might be if it’s a corporate web site that numerous developers, QA personal, and others employees are visiting from the same address space it could skew the analytics results because of such a high concentration of traffic from one IP address or subnet. One of the great reasons for reviewing the web analytics data provided by Google Analytics is to see what pages customers view or what region your customers are from. This type of data can help prioritize the areas of the site that should be worked on the most or what content provides the best return on investment and if the data includes your own traffic it might not provide accurate data for you to review.
So to get around including your web traffic to the site you are monitoring via Google Analytics you can create filters from within Google Analytics so your personal traffic is not included. Adding a single IP address is very easy to do using the predefined filters provided by Google. First I will describe adding a basic filter followed by adding a filter that excludes an entire subnet of IP address space such as a large corporate office that is developing the site. Please note that if you are monitoring numerous sites with a single Google Analytics login that the filters are used on a site by site basis though you can apply a filter from one site to another site using the Filter Manager.
Fitler A Single IP Address From Google Analytics Results:
- Login & Click Account: First login to Google Analytics here. After you have logged in click on the account that the site you want to modify is listed under as shown in the below image.
- Open Filter Manager: Below the list of website profiles are a couple links to Google Analytics tools including Add Website Profile, User Manager, and Filter Manager. Click on the Filter Manager link which is shown in the below image.
- Configure New Filter: Now with the Google Analytics Filter Manager open as shown below click on the Add Filter in the top right corner of the list of filters.
This will open the Create New Filter window where the new filter will be configured. For a single IP address we will be using a predefined filter which is the default setting as determined by the radio button on the second row of configuration items. First type in a name for the filter such as “Home IP Address” as shown in the example image below. Next on the Filter Type configuration line change the second drop down from “traffic from the domains” to “traffic from the IP addresses” so the line will now read “Exclude traffic from the IP addresses that are equal to” also shown in the below example. Next enter in the external IP address assigned to your home. Make sure that you do not use one of the internal IP addresses on your network as those do not show to anything outside of your home network. The last configuration option that needs to be added is selecting the website or websites that this filter will be applied to which in the case of this example will include www.question-defense.com.
- Save Analytics Filter: Click the Save button in the bottom left hand corner of the Add New Filter window which will save the filter and redirect you back to the Filter Manager page where you can view the entire list of filters including the new one that has just been added. Now if you are at the location the filter was added to visit your site a bunch of times so you can view Google Analytics tomorrow to see if traffic from your address has been excluded.
Now you know how to add a single IP address to be excluded from Google Analytics results but what if you want to add an entire subnet as a single filter. You may want to do this if you work for a large corporation with many employees all working on the site and if all of the traffic from those employees was showing under Google Analytics it might provide inaccurate data for the site. Use the below directions to add a group of IP addresses or an entire subnet.
Create a Google Analytics Filter For An Entire Subnet Of IP Addresses:
- Open Filter Manager: Follow the first couple of steps above to open the Google Analytics Filter.
- Configure New Filter: Now click the Add Filter link as described in the above steps but this time instead of leaving the default Predefined radio button selected change that to the Custom Filter radio button so you have more control of the settings. First name the filter whatever will help you recognize it in the future and make sure the second set of radio buttons has Exclude selected. Change the Filter Field drop down to Visitor IP Address as shown in the below example. Now the tricky part is the Filter Pattern which is where you can specify a single IP address or a group of IP address wether it is a subnet or not. I this example we want to exclude a entire class C (/24) such as 22.214.171.124/24. The filter pattern for blocking that entire block of addresses is shown below followed by the filter pattern for blocking a group of only two IP addresses. Google provides an online filter patterrn generator located here.
Filter Pattern For Entire Class C: 126.96.36.199/24bash
Filter Pattern For 2 IP Addresses: 188.8.131.52, 184.108.40.206bash
Now just save the filter and test as described in the last step above.
There are many options for custom filters so spend some time looking into all of the options. Google Analytics is a great free service provided by Google as many other web analytics software costs a ridiculous amount of money.