Filter Working-From-Home Employees In Google Analytics

With the surge in working-from-home employees, many people are trying to figure out how to exclude this “internal” traffic from their Google Analytics reports. There is a simple option for sites with low to moderate traffic.

The Problem

The typical approach to excluding internal traffic in Google Analytics is by “IP filtering“, but that really only works with a small number of fixed locations with stable internet connections. When people start working from home (or coffee shops), their IP addresses can change from day-to-day, so a different solution is required.

The Options

There are three ways that you can stop specific traffic from appearing in your reports:

Do not track the visits in the first place

This approach stops the Google Analytics snippet from recording the visit. This could be accomplished with a browser add-on like the Google Analytics Opt-Out browser add-on. It means you need all of your internal users to install the add-on in all of the browsers they use, then to properly select the options to stop sending tracking data. For non-technical users, this could be problematic.

A derivation of this approach uses cookies obtained by visiting an internal-only page or during a login script. The tracking code is then modified to exclude tracking if that cookie is available.

Stop (filter) the hits as they are received in Google Analytics

This approach involves view filters — typically filtering by IP — that exclude traffic based on the internet address it came from. For a few fixed and stable locations, this is fine, but the dynamic nature of working-from-home makes this impossible to manage. Some internet providers could change the IP address used at any time.

Filter (segment) the traffic out of your reportsĀ 

This approach uses filters or segments to remove visits from your reports based on a characteristic of the visitor. Historically, people could filter out traffic from specific Network Domains or Service Providers, but Google Analytics no longer populates that data. This leaves us with fewer options — and the suggested solution below is one of them.

Simple Little Solution

Exclude Users That Visit A Specific Page

The suggested approach is to provide a page only for internal users, and to create a simple segment in Google Analytics to exclude any users that visit that page. It’s not a perfect solution, but it is relatively quick and easy to implement, and it works retroactively. It does require that your users visit the specific page (and non-internal users to NOT visit the page), and since it uses a segment, higher traffic sites may experience some data sampling caused by the use of a segment.

Note that the segment filters Users, not Sessions — this is important as it would otherwise require that your internal users visit your internal-only-page during every session. It also has the benefit of historical filtering: it filters out previous sessions they had from the same browser. This retroactively filtering of internal traffic is not possible with the other approaches.

BRIGHT IDEA: you could use a URL parameter on your homepage instead of a whole new web page, sending the link to your workers like “https://www.analyticsedge.com?internal”, and look for the URL with the parameter in your segment.

Cautions and Limitations

Note that it will only work if the internal users actually visit the internal-only-page. Provide your users with some content of value on that page to encourage visits.

It also makes your reports susceptible to data sampling with higher website traffic volumes, so make sure to check.

You also need to make sure the internal-only-page is not accessible to outside users, at least not through the usual navigation on the website.