Exclude staff visits from GA4 when your team works from home

By Sina Esfahani, OmniTechs · Published 30 November 2026

Google Analytics 4 recognises internal traffic by IP address. That works for an office with a fixed public address. It fails for colleagues at home: their address belongs to their own internet connection, it can change, and you should not collect every employee's home address anyway. The reliable route for a mixed team is to mark the browser instead of the connection. Each colleague opens a staff-only link once; Google Tag Manager stores a small cookie and from then on sends the parameter traffic_type with the value internal with every event. GA4's internal traffic filter then removes those events, just as it does for the office address.

Your first action takes two minutes: in GA4, open Admin, then under Data collection and modification click Data filters, and note which filters exist and their state. Set nothing to Active until you have tested it. An active filter deletes the matching data for good, and it does nothing for data you already have.

Set it up in this order:

  1. Office with a fixed public address: add an IP rule under Define internal traffic, with the value internal.

  2. Home workers: create a staff link that sets a cookie, and let Tag Manager send traffic_type = internal whenever that cookie is present.

  3. Create one Internal Traffic data filter with Exclude, in the state Testing.

  4. Ask every colleague to open the staff link once in each browser they use for work, on laptop and phone.

  5. After 24 to 36 hours, check the Test data filter name dimension in Explore: staff events present, customer events absent.

  6. Switch the filter to Active, and add a Developer Traffic filter so tests in Tag Manager's preview stay out of your reports.

  7. Write down the activation date: everything before it still includes staff visits.

Which route fits your team

How to recognise staff, by working pattern

Editorial summary of the routes described in Google's Analytics and Tag Manager help pages, read on 30 November 2026.
Your situationWhat recognises staffWeak point
Everyone works in one office with a fixed public IP addressAn IP rule in the GA4 data streamVisits from home, phones on mobile data and a changed office address are missed
Office plus home workingAn IP rule for the office plus a staff cookie in every work browserEach browser on each device needs the link once; clearing cookies removes the mark
Fully remote, or the office address changesA staff cookie through Google Tag ManagerNeeds Tag Manager access or a developer
Someone is testing tags or formsDebug mode in Tag Manager's preview plus a Developer Traffic filterCovers only sessions opened in debug mode

Why the IP rule misses people at home

GA4 marks an event as internal when the public IP address it comes from matches one of your rules. A rule can match an exact address, the start or end of one, a part of one, a range in CIDR notation or a regular expression. IPv4 and IPv6 both work, and several conditions in one rule count as OR (Google: Filter out internal traffic).

That suits an office line with a fixed address. A home connection is different. The address is assigned by the colleague's provider, it may change without notice, and it is shared with everyone else in that household. A rule for it either goes stale or catches people who are not staff. A broad rule such as "begins with" on a provider's range is worse: it can remove real customers who use the same provider.

One exception: if staff connect through a company VPN that always leaves the internet from the same address, that address behaves like an office address. Connect to the VPN, open the rule screen and use "What's my IP address?" to see it.

Step 1: Add the office address, if you have one

You need the Editor role on the GA4 property.

  1. In Admin, under Data collection and modification, click Data streams and open your web stream.

  2. Click Configure tag settings, then Show more, then Define internal traffic, then Create.

  3. Name the rule, for example Office, and keep the traffic_type value internal. Using the same value for every route means one filter covers them all.

  4. Under IP address, choose a Match type and enter the Value. Click "What's my IP address?" while you are on the office network to see the public address.

  5. If the office also has an IPv6 address, add it with Add condition. Click Create.

Step 2: Mark staff browsers through Tag Manager

Google's help says Analytics adds traffic_type when an IP rule matches, and that you can also add the parameter to your events yourself. In Google Tag Manager that takes three parts.

The staff link. Pick a link only staff will use, for example your homepage with ?staff=yes added. Under Triggers, click New, choose Initialization as the trigger type, select Some Events, and add the condition Page URL contains staff=yes. Initialization fires before all other triggers except consent initialization.

The cookie. Under Tags, click New, choose Custom HTML and attach the trigger above. The tag needs one line of JavaScript that writes a first-party cookie named staff_traffic with the value internal, the path / and a lifetime of one year (max-age 31536000 seconds). A web developer can write that line for you. A second link, such as ?staff=no, with a tag that sets max-age to 0 lets a colleague switch the mark off again.

The parameter. Under Variables, click New and choose 1st party cookie with the cookie name staff_traffic. Then create a second variable of the type Google Tag: Event Settings and add a parameter named traffic_type whose value is the cookie variable. Select that variable under Shared event settings in your Google tag. Add it to every GA4 Event tag as well: Google states that event parameters only apply to the tag you add them to.

Visitors without the cookie get an empty value. Their events carry no internal mark, so the filter leaves them alone.

Check it before you publish. In the Workspace tab, click Preview to open Tag Assistant and connect to your site. Open the staff link, then a second page. Tag Assistant shows which tags fired and what data they passed: the cookie tag should fire on the staff link, and the Google tag should pass traffic_type with the value internal on the second page. Then click Submit and publish the version.

Three limits to tell your team:

  • The mark lives in one browser on one device. Chrome on the laptop and Safari on the phone each need the link once.

  • Safari deletes cookies that JavaScript created after 7 days without interaction with your website (WebKit tracking prevention). A colleague back from two weeks' leave opens the link again. The same goes for private windows and cleared cookies.

  • The Google tag also starts at initialisation, so the page opened through the staff link itself may still count as a normal visit. Open one more page afterwards.

No Tag Manager? If the Google tag sits directly in your site's code, a developer can add the same traffic_type parameter there when the cookie is present. Google confirms only that the parameter can be added manually; it gives no recipe for that route.

Tell staff what the cookie does

The cookie holds one word and is set only when a colleague opens the link, but it is still a cookie on their device. In the Netherlands, the Autoriteit Persoonsgegevens explains that functional cookies and limited analytical cookies with no or little privacy impact need no consent, but you must say that you place them (Telecommunicatiewet, article 11.7a). In the UK, the ICO's PECR guidance requires consent for cookies that are not strictly necessary, and the ICO notes that this guidance is being revised. Explain the cookie in your staff instructions, mention it in your cookie or privacy statement, and let each colleague open the link themselves. This is general information, not legal advice.

Step 3: Create the filter in Testing and check it

  1. In Admin, under Data collection and modification, click Data filters. If an internal traffic filter already exists, use it rather than creating a second one. A property can hold 10 data filters.

  2. Click Create Filter and choose Internal Traffic.

  3. Give it a name of up to 40 characters, using letters, numbers, underscores and spaces.

  4. Choose Exclude, which removes events whose traffic_type matches your rule value.

  5. Set the filter state to Testing and click Create.

In Testing nothing is removed. GA4 tags matching events with the filter's name in a dimension called Test data filter name. It can take 24 to 36 hours before values appear.

Then build the check Google describes. In Explore, start a Free form exploration. Rows: Test data filter name and Event name. Values: Event count. Filter: Test data filter name contains your filter name.

What the test should show, and what to do if it does not

Pass conditions follow from the filter behaviour in Google's Analytics help, read on 30 November 2026. The test visits are an editorial suggestion.
Test visitPassIf it fails
A colleague at home, with the cookie, sends a test enquiry they can recogniseTheir events appear under your filter name, including the enquiry eventCheck in Preview that the cookie tag fired and that the cookie name matches the variable exactly
The same colleague triggers an event that one of your GA4 Event tags sendsThat event also appears under the filter nameAdd the Event Settings variable to that GA4 Event tag
Someone in the office, if you added an IP ruleTheir events appear under the filter nameCompare the rule with "What's my IP address?" on the office network, and add the IPv6 address
A phone on mobile data, in a private window, without the linkIts events do not appear under the filter nameLook for an IP rule that is too broad, or a staff link that has been shared outside the team

Two quicker views exist outside Explore. Google lists Test data filter name among the dimensions you can use in a report filter, so you can click + Add filter in a detail report and choose it. A comparison works the same way if your report offers that dimension, which shows staff and other traffic side by side.

Step 4: Activate it and keep testing possible

Open the filter, set the state to Active and save. Google says it can take 24 to 36 hours to apply. From then on, matching events are never processed and never appear in Analytics or BigQuery. Setting the filter to Inactive later stops the filtering; it does not bring back what was excluded.

Your team still needs to test forms and tags. Do that in debug mode: Tag Manager's Preview turns it on for your own browser, and you watch the events arrive under Admin, Data display, DebugView. Then add a second filter: Create Filter, Developer Traffic, Exclude, tested the same way. Google designed this filter so that developers can keep using DebugView while their activity stays out of your reports.

Run those tests in a browser without the staff cookie, such as a private window. Google does not say whether events removed by the internal traffic filter still show in DebugView, so keep the two routes apart.

What you cannot fix in past data

Data filters work from the moment you create them; they do not change historical data. Staff visits collected before activation stay in your reports. Nothing in GA4 removes them afterwards.

What you can do:

  • Write down the activation date and treat it as a break in your figures. If visits drop after that date, part of the drop is your own team.

  • Events collected while the filter was in Testing carry the Test data filter name value, and those data are kept. During that period, a report filter on that dimension hides them without deleting anything.

  • To hide data in a report without removing it, use report filters. A data filter is the permanent tool.

Worked example: a six-person team

This example is hypothetical. A six-person installation company has two people in the office, which has one fixed public address. Three colleagues work from home two days a week, and the owner mostly uses a phone.

  1. Monday: an IP rule named Office, IP address equals the office address, traffic_type internal.

  2. Monday: the staff link ?staff=yes, the cookie tag, the cookie variable and the Event Settings variable, checked in Preview and published.

  3. Monday: each person opens the link on their laptop and phone. That is up to twelve browsers, and the list goes into the team's onboarding notes.

  4. Monday: an Internal Traffic filter named Internal traffic, state Testing.

  5. Wednesday: in Explore, a home worker's test enquiry and the owner's phone visits appear under Internal traffic. A visit from a private window on mobile data does not. The filter goes to Active.

  6. Next month, Safari on one phone has lost the cookie after a fortnight's holiday. The colleague opens the link again.

The contrast case: if all six worked in the office every day, step 1 alone would do. The cookie route only earns its place once people work elsewhere.

When to stop, and what to check later

  • The internal traffic filter does not apply to app users; it covers websites only.

  • If your site sends data through a Tag Manager server container, keep the filter in Testing until you can see staff events labelled correctly. The help pages used here do not cover that route.

  • If the test still fails after the checks in the table, stop before activating. Someone with Editor access to GA4 and publishing rights in Tag Manager has to trace it with Preview.

Add a GA4 check to your website maintenance checklist: after a site or tag change, run one staff visit and one private-window visit and confirm the labels in Explore. If you would rather have the measurement checked, the OmniTechs Google Analytics tracking audit checks, among other things, whether your property measures the right site without your own visits and test traffic. It costs a fixed €200 excluding VAT.

Filter out internal traffic (Google Analytics)

This 106-second video from Google accompanies the help page for the office IP route and the filter test. It dates from 2023, so some screens may look slightly different.