Analytics | April 3, 2020

How To Filter Remote Workers Traffic Out Of Analytics

How To Filter Remote Workers Traffic Out Of Analytics Image

It’s likely with a large proportion of employees now working remotely, some businesses will have their data artificially inflated this month by remote workers accessing the website from IP addresses not blocked in Google Analytics’ filters. We share how best to stop this from happening…

In the current climate with this unprecedented situation we find ourselves in, there have been many changes to the way people are working. For most, this means remote working, and whilst that brings a whole host of obvious challenges with it (i.e. productivity) there is another obstacle presenting itself.

Artificial inflation of traffic figures. This inflation comes from internal employees, whose IP addresses aren’t excluded in Google Analytics.

Usually, the internal business IP address is filtered out of Google Analytics to reliably block traffic coming from inside the business premises. Since employees don’t behave like typical web users it’s likely they will alter the metrics most reported – like users, sessions and page views, skewing the data.

The issue is that an employee’s home IP address will not be filtered out, and it would be virtually impossible to simply block all home IP addresses since most home broadband and ADSL connections have dynamic IP addresses that change on a weekly, or daily basis. Therefore, when they access the website the tag will fire and record the session as external traffic.

Businesses who employ digital marketing agencies, who will no doubt be using crawling software such as Screaming Frog, data soon becomes inflated data across the majority of the site.

The issue at hand is relative to the number of employees and the volume of traffic the site receives. For example, a business with less than 50 employees now accessing the site from home will have very little impact on a website that receives hundreds of thousands of pageviews per month. However, a site with a smaller number of pageviews, such as B2B site, could have their data skewed on a much larger scale.

Why does this matter?

The biggest problem is that it will skew the figures, inflating the traffic that the site and specific pages receive, making it very difficult to understand the genuine performance of the site.

As well as affecting the macro metrics like page views, there will be a direct impact on user behaviour metrics, such as pages per session, average session duration etc. This is simply because employees will not navigate the site and act in the same way an external user would.

All of this risks having an impact on wider business goals as well as the data accuracy for planning your online marketing activity.

How to fix it

The answer to fixing the problem at hand is not an easy one, because there are several ways to overcome this problem. None are wrong, but there are methods that would be more accurate and simpler to implement.

We put our heads together and tested our favourite option.

This solution relies heavily on the use of Google Tag Manager. It works by using a custom cookie on a URL parameter that is only visible to internal employees, the cookie then fires an exception trigger once a user has visited this unique URL.

The cookie then acts as a custom dimension and all future on-site behaviour will be excluded from the Analytics reports.

Here is what we did:

#1 The cookie can be inserted via a Bookmarklet (a bookmark stored in a browser that contains JavaScript commands), though it is much simpler to apply through Google Tag Manager. If you don’t already have and use Tag Manager on your website, you can do this by adding a script to the <head> section.

The cookie needs to be assigned to a new tag on a URL parameter.

#2 The cookie we’re creating needs to be triggered on a specific URL parameter that will only be accessible to internal users. This means the cookie will only be received if this URL parameter is accessed first.

#3 You then need to navigate to the Google Analytics Admin section and set up a custom dimension.

#4 Once this is done, head back to Tag Manager and click the Variables tab.

#5 Create a new User-Defined Variable. Set the Variable Type to 1st Party Cookie.

#6 Head back to the tag section and click on the tag that fires the Analytics tracking code. Click More Settings > Custom Dimension. Now add in the Custom Dimension ID, head back to Analytics and you’ll see it in the Admin section. Click the Lego brick and set this to the cookie that was set up earlier.

#7 All we need to do now is set up the filter in Analytics. In the Admin section of Analytics, click Add New. Name the filter Internal Traffic Excluded and select Custom filter type and select your cookie variable, name it something like Internal Traffic so it is easy to find. Enter true into the filter pattern and hit save.

Hey presto internal traffic is filtered out!

#8 To test it is working simply visit the URL with the cookie deployed and then visit other URLs, look at the Real-time report in Analytics. It should now not track you as a visitor on these pages and you will not show up in the live report.

This custom cookie can be added to a specific page that can be created just for internal employees to visit. It can also filter out Screaming Frog crawls if the crawl is configured correctly. The crawl will need to begin on the URL that the cookie is deployed on and JavaScript and cookies will also need to be enabled.

If you need it, here is a helpful step-by-step run-through of how to implement this.

How to maintain it

All employers will have a method for communicating to all staff, so ensure that the message is clear; for anyone using/visiting the website at home to access the site via this URL (www.example.co.uk/staff/).

Employees will need to visit the designated URL with parameter every 30 days at a minimum. They will also need to visit the same URL anytime they clear their cache in order for this to work correctly.

By asking employees to use this designated URL and parameter, it limits the inflation of traffic, however, it is likely that employees will forget from time to time – whether that’s after 30 days of its first use or after their cache has been cleared, therefore, it isn’t entirely perfect. But it’s the easiest to implement and most straightforward.

Good luck, and stay safe!

We’re proud to be an official Premier Google Partner.