How to Filter-Out Traffic from Staff that Working From Home in Google Analytics?

While remote working is a common thing for a lot of companies, they don't usually happen in a large scale, like your entire company/staff. But due to recent Coronavirus outbreaks, more and more company demand all staffs to work from home. While that's a good sign that the company's care about their employees health and safety, this company-wide work from home mode brings pain to Marketing division, well at least for Marketing that rely on website to get customers, or at least to me as a Growth Hacker in a company that I work for right now. If you are here reading this article, I believe you also facing a same issues like most of us and looking for solutions.

Filtering-out internal traffic when most employee is working from the office is easy, you can just use Google Analytics built-in filter by heading to your Google Analytics Dashboard --> Admin (left bottom corner) --> All Filters (under Account) or Filters (under View) --> Add Filter.

Google Analytics - Filter - Exclude Traffic from IPs

So, how to filter-out traffic from staff that working from home in Google Analytics? There's some solutions that I manage to discover that you can apply with or without the help of developers.

1. Using Browser Extension: "Block Myself from Analytics"

This is the most accurate and effective way, but most complicated for your staff, mainly if you have hundreds or thousands. Here's how to do it.

  1. Ask them to install this browser extension on their most used browser (Google ChromeMicrosoft EdgeMozila Firefox).
  2. After installation completed, ask them to visit your website homepage from that browser.
  3. Click the extension icon on the browser toolbar, then
  4. click/tick the "Block Analytics for this website".

If you have a lot of website/domains (including sub domains), you can click "Options" and input all of the them to the bottom field one by one then click "Apply" or "Save".

Block Myself from Analytics Browser Extension Setting

2. Ask them to Always Login and Filter it on Google Tag Manager

This solution can only be used if you're site is not a membership site or do not require users to login into your website (so in most B2C company, this is not something you want to do). Also, if you do not use Google Tag Manager to deploy your Google Analytics tracking property, you can't do this. But I suggest you to start using GTM to deploy all of your tracking.

  1. Create a new Variables, give it name something like "Login Status",
  2. choose "DOM Element" as its Variable Type,
  3. choose "CSS Selector" on Selection Method,
  4. type or copy and paste "body.logged-in" (without quote) on Element Selector (this only valid for WordPress site, if you use other CMS, you may need to consult with the developers or try to find the value using Inspect Element),
  5. type "class" (without quote) on Attribute Name, then
  6. click Save.

Google Tag Manager - Create Variable - Login Status

Now, go to your Tags, heads to your Google Analytics tag setting, then

  1. remove "All Pages - Page View" Trigger (or DOM Ready, depend on your setup),
  2. create new Trigger (click + icon on top right corner),
  3. give it a name something like "User Not Logged-in",
  4. choose "Page View" as its Trigger Type,
  5. click "Some Page Views" on This trigger fires on,
  6. choose previously created Variable (in this sample is "Login Status") in the left drop down field,
  7. choose "equals" as the rule (center field),
  8. type or copy and paste "null" (without quote) to the right field, then
  9. click "Save".

Google Tag Manager - Create Trigger - User Not Logged-in

Note: Make sure that your Google Analytics page view setting using this new trigger.

If all done, you can Publish your container. Or, if you want to make sure that the new setting applied, you can use GTM Preview mode, login to your website, then see if your Google Analytics tag triggered or not. If not, then your setting is success. If it's still triggered, try to do hard refresh or check again above steps.

3. Ask Staff to Only Visit Website Using Dedicated UTM

This is the easiest way, but there's a good chance your employee forgot it and still screwing your analytics data. If you want to try it, here's what you need to do.

  1. Setup dedicated UTM (utm_source only is enough) for all staffs, I use "utm_source=test".
  2. Go to your Google Analytics Dashboard --> Admin --> Filters --> Add Filter, then
  3. give it a specific name, I use "Exclude Test Traffic",
  4. click "Custom" setting under Filter Type,
  5. click "Exclude" then "Campaign Source" under Filter Field,
  6. type that UTM value (test) to the Filter Pattern field, then
  7. click "Save".

Then, you have to make sure that all employee only use that dedicated link (yourdomain/?utm_source=test) when visiting your website so that Google Analytics will filter-out all traffic and activity from that link. This is the hardest and unreliable part.

Google Analytics - Filter - Exclude Specific UTM Traffic

Those are 3 ways to filter-out internal traffic from your staff that working from home that I manage to discover. There's also another way but require your web developer to do it (will need to attach 1st party cookie), which have been written by Joshua Morse here.

Do you know another way to do this? Let me know in the comment section below. Lets help other Marketers out there!


Leave a Comment

@TravellersID you can buy royalty-free license of stock photo and stock video; search, compare, and book cheap flight ticket, hotels, and car rental around the world; or hire us for social media management, content writing, or video production services.