Google Analytics 4 filters is one of the hottest topics at the moment and a small wonder because when you install Google Analytics 4 on your website or transit from Universal Analytics, one of the first things you should do is to set up filters. 

Otherwise, you will track your and your team’s website visitors or app sessions. Thus, the data will be skewed, and you won’t be able to rely on it to make the decision. 

Therefore, it is crucial to set up filters and, more importantly, select the right one. Let’s start with the filters GA4 supports.

What filters are supported in Google Analytics 4?

Selecting Internal Traffic From GA4 Filters

For now, there are not many filters that Google Analytics 4 officially supports. The main ones are:

  1. Internal traffic filter
  2. Developer traffic filter

There is also a solution to filter the data by hostname and a ga4 lowercase filter, but these are rather workaround solutions than the official ones provided by Google. 

Note: I set myself a goal to update this article with new filters that appear in Google Analytics 4. If you don’t want to visit this article multiple times, you can subscribe to my GA4 newsletter, and I will let you know about every new GA4 feature, including filters.

In the meantime, I highly recommend setting up both filters for your GA4 property. The main reason lies in their difference. 

What is the difference between developer and internal traffic filters?

You can find much information on the internet about why you should set up an internal traffic filter. However, only a few people understand the value of developer traffic filters.

Internal traffic filter filters all your and your team’s data from the GA4 property. It means you won’t be able to see it in all GA4 reports. 

The developer traffic filter filters all your data from all GA4 reports apart from the DebugView report. This report is essential to test your analytics-related implementations and allows you to check every change before deploying it to production.

Suppose you don’t enable the developer traffic filter to have an internal traffic filter. In that case, you and your devs will blindly implement changes that can negatively impact your analytics and business performance.

So that we are on the same page, let’s look at how to set up the GA4 filters.

How to set up traffic filters in Google Analytics 4?

Although I will mention here the way how you can set up internal and developer traffic filters in Google Analytics 4, I highly recommend reading my dedicated articles about them: “How to filter internal traffic in GA4 (Google Analytics 4)?” and “Why should you use a developer traffic filter in GA4?”

They will give you a better understanding of how to set them up in Google Analytics 4, how to test them, and when to activate them.

How to set up an internal traffic filter in GA4?

Step 1 determine your IP address
Find your IP address on whatismyipaddress.com

Step #1: Define your (or your team’s) IP address.

You can use such websites as https://whatismyipaddress.com/

Set up a GA4 Internal Traffic Rule

Step #2: Create a GA4 rule to detect your IP (your team’s) IP address as internal traffic

Step #2.1: Log in to your Google Analytics 4 property and visit the Admin section

Step #2.2: Click on “Data Streams” 

Step #2.3: Click on the particular data stream to see the stream details

Step #2.4: Click on “Configure tag settings”

Step #2.5: Click on “Show all” and select “Define Internal Traffic”

Step #2.6: Click on “Create” button and setup the rule

  • Name a rule. For instance, “GA4 Internal Traffic”
  • “traffic_type_value” should equal “internal”
  • Select match type. For instance, “IP address equals” and provide your IP address from the first step to “value” field
  • Click on “Create” button
Create a GA4 Filter to block internal traffic

Step #3: Create a GA4 filter to block internal traffic

Navigate to GA4 -> Admin -> Data Settings -> Data Filters

Step #3.1: Go to Admin section in GA4 and click on Data Settings and select “Data Filters”

Step #3.2: Click on “Create Filter” button

Step #3.3: Select “Internal Traffic” type

Step #3.4: Provide the following settings to the filter:

  • Name the filter. For instance, “GA4 Internal Traffic Filter”
  • “Filter Operation “ equals “Exclude”
  • Parameter name “traffic_type” equals “internal” (provide the value here you used in 2.6.1 point above)
  • Select Filter State “Testing” for testing purposes or “Active” if you want to make it live in a moment.   
  • Google will show an instruction you how to test your filter. Close it. 

Step #4. That’s it!

How to set up a developer traffic filter in GA4?

Providing-GA4-Developer-Traffic-Filter-Settings
Setting up a developer traffic filter in GA4

Step #1: Open GA4 -> Admin Page -> Data Settings -> Data Filters -> Create a new filter (Select “Developer Traffic filter”

Step #2: Set up the filter using the following parameters:

#1 Name the filter, for instance, “Exclude My Devs From GA4 Data”

#2 Select “Exclude” as the filter operation

#3 Select the filter state. If you want to test your filter, select “testing”. 

Once you enable the developer traffic filter, you should send “{ ‘debug_mode’:true }” code into Google Analytics 4 with every event your devs generate. If you use GTM, GTM Preview Mode sends it automatically. 

If you use Firebase (mobile app) or GTAG, you must set it up manually. 

In the case of Firebase, you should enable debug mode using the following code for iOS devices:

-FIRDebugEnabled

For Android

adb shell setprop debug.firebase.analytics.app PACKAGE_NAME

If you use GTAG.js, you must provide { ‘debug_mode’:true } variable into page view and evens code. You can read more about it in this documentation

After all these implementations, you are thoroughly done with official Google Analytics 4 filters. 

But, wait, what if you want to filter your GA4 data by hostname?

How to set up a hostname filter in Google Analytics 4? 

As I mentioned above, unlike Universal Analytics, Google Analytics 4 doesn’t have a hostname filter yet. Therefore, I dedicated another article to explain how you can use Google Tag Manager to implement the workaround. Here I will provide a brief version of it. 

However, before that, I recommend you look at the “Top hostname by Users” chart in Google Analytics 4. You need to take the following steps to find it:

  1. Login to the GA4 account
  2. Click on the Search bar and type “hostname”
  3. Select the report “Top Hostname by Users”
Showing-how-to-find-hostname-report-in-ga4-solution-a
Showing “Top Hostname by Users” report in GA4

If you see only one hostname (the same as in my screenshot above), you may not need to filter your data by a hostname, but if you have more than one and some are incorrect, you can open Google Tag Manager and follow the next steps:

How to set up Hostname GTM Variable
Create a new variable to set up a hostname filter in GA4

Step #1: Create a new variable

1. Name “My Hostname RegEx Table”
2. Variable Type – RegEx Table
3. Input Variable – Page Hostname
4. Pattern – your domain (for instance, “www.vakulski-group.com”)
5. Output – your GA4-measurement Id (for instance, G-KF9LRYZ10K)

How to set up Hostname GTM Trigger
Updating your main GA4 tag

Step #2: Update your main GA4 tag to use the variable you created (after that, all your GA4 event tags will use that RegEx table)

Publishing-gtm-container
Publish a GTM container

Step #3: Publish a GTM Container

After you publish the GTM container, GTM will send the data only from the hostnames you specify. However, it doesn’t mean that you won’t receive data from some domains that you can’t control. For instance, your competitor can send the data to your GA4 using API. 

Once we discussed all filters you can set up in Google Analytics 4, let’s look at what limitations GA4 filters have.

How to set up a lowercase filter in Google Analytics 4? 

As I already mentioned, unlike Universal Analytics, Google Analytics 4 doesn’t have a lowercase filter yet. Therefore, I dedicated another article to explain how you can achieve the same results using Google Tag Manager. Here I will give a quick overview of it.

To lowercase UTM parameters in Google Analytics 4, take the following steps.

Step #1: Open GTM and create a new variable

1. Variable Type – URL
2. Component Type – Query
3. Query Key – utm_campaign
4. Format Value – Change cases to – lowercase
5. Save it and give it the name  “utm_campaign”

GTM Variable - UTM Parameter Lowercased
GTM Variable – UTM Parameter Lowercased

Step #2: Open your GA4 configuration tag and make the following adjustments in “Fields to Set”:

1. Field Name – campaign
2. Value – {{utm_campaign}} (our variable we created early)

GTM Tag Updated to lowercase utm_campaign values
GTM Tag Updated to lowercase utm_campaign values

Step #3: Publish the GTM container

Publishing-gtm-container
Publish the GTM container

After you make the changes mentioned above, the GA4 will start to receive the UTM parameters in a lowercase format.

What are the limitations of the filters GA4 has?

Firstly, GA4 has only two filters at the moment: developer traffic and internal traffic filters. It’s a vast limitation compared to what Universal Analytics offers. To remind you that Universal Analytics allowed you to set up at least the following filters:

  1. internal traffic filter
  2. convert all campaigns names, and page URLs to lowercase
  3. filtering by a hostname
  4. search and replace any parameter you need
  5. language spam filter and etc.

Secondly, you can create up to 10 filters in Google Analytics 4. Universal Analytics didn’t have this limit. 

Final Thought

Although Google updates Google Analytics 4 every month, GA4 officially offers only two filters: internal and developer traffic filters. There is a workaround to set up a hostname filter and a lowercase filter using Google Tag Manager, but it has disadvantages. I recommend you set up 2 officially allowed GA4 filters after you migrate from Universal Analytics or install GA4 on your website or app


What are data filters in Google Analytics 4?

Google Analytics 4 filters are a feature of GA4 that allows you automatically filter the incoming data by a specific parameter. GA4 allows you to use two filters: internal traffic and developer traffic filters.

What filters are supported in Google Analytics 4?

At this moment, Google Analytics 4 supports only two filters:
1) internal traffic filters
2) developer traffic filters

You can use Google Tag Manager to set up a hostname filter, but it has its own disadvantages.

What is the difference between developer and internal traffic filters?

Internal traffic filter filters all your and your team’s data from the GA4 property. It means you won’t be able to see it in all GA4 reports. 

The developer traffic filter filters all your data from all GA4 reports apart from the DebugView report. This report is essential to test your analytics-related implementations and allows you to check every change before deploying it to production.

Written By

Ihar Vakulski

With over 8 years of experience working with SaaS, iGaming, and eCommerce companies, Ihar shares expert insights on building and scaling businesses for sustainable growth and success.

KEEP LEARNING
Leave a Comment

Your email address will not be published. Required fields are marked *

[custom_comment_form]