Google Analytics Hacks: Filtering Internal Traffic With Dynamic IP Adresses

Excluding Internal Traffic for Geographically Dispersed Teams

If you are using any web analytics tool to measure your website usage, then it is highly recommended that you filter out the data generated by internal members of your team. Google Analytics offers several ways to filter internal traffic and the most common method relies on IP addresses.

Limitation on IP Based Filtering Method

Telecommuting is becoming more popular in today’s workforce and thus your staff members could be geographically dispersed making it challenging to use IP addresses to filter internal traffic. In this blog, you will learn how to overcome the above challenge using an alternate method for filtering internal traffic.

Alternate Method for Filtering Internal Traffic using Google Analytics

On a high level, we will use a JavaScript function to set a cookie on every internal computer and then filter all visitors with this cookie using an advanced filter.  Here are step by step instructions on how to implement this setup:

Step 1: Create a new web page

Either create a separate HTML page that is not a part of your website or create a new page on your site which is not publicly accessible to your visitors.

Step 2: Add pageTracker.setVar()

In addition to the Google Analytics Tracking Code (GATC), add the following line of code on this newly created web page:

Sample of GATC with setVar Method

In the above example, the setVar method will help us uniquely identify and filter out internal visitors based on the parameter labeled internalstaff.

Step 3: Create an Exclude Filter

In Google Analytics, Create an exclude filter to exclude data from visitors with the above parameter. Follow these instructions:

  1. Choose the custom filter option and provide an appropriate filter name
  2. Select filter type = Exclude
  3. Use the drop down menu and select filter field = User Defined
  4. Enter filter pattern = internalstaff (name of the parameter)
  5. Select case sensitive = No
  6. Assign appropriate profile and save the filter.
Filter for Excluding Internal Traffic

Step 4: Direct All Staff to Your New Page

Request your internal staff members to visit the newly created web page from all computers that you would like to exclude from your data.

You are all set, the above procedure will allow you to filter internal traffic irrespective of IP addresses.

About Webucator

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, Azure, Windows, Java, Adobe, Python, SQL, JavaScript, Angular and much more. Check out our complete course catalog.

4 thoughts on “Google Analytics Hacks: Filtering Internal Traffic With Dynamic IP Adresses”