How to Filter in Google Analytics 4
Your Google Analytics 4 property is collecting a ton of data, but not all of it tells the right story. Visits from your own team, traffic from staging websites, and user activity from countries you don't serve can all cloud your reports and lead to incorrect conclusions. This is where filtering comes in. This tutorial will walk you through the essential ways to filter data in GA4 so you can focus on the metrics that actually matter to your business.
Understanding Filters in GA4: The Two Main Types
Unlike Universal Analytics, where Views were used to create permanently filtered sets of data, GA4 handles filtering differently. It's important to understand the two primary ways you can filter your data, as they serve very different purposes.
- Data Filters (Permanent): These are administrative-level filters used to permanently include or exclude specific data from being processed into your reports. The most common use case is excluding traffic from your own company's IP addresses so you're not counting your own employees' activity as customer engagement. Once a Data Filter is active, the data it excludes is gone for good, you can't get it back.
- Report Filters (Temporary): These are flexible, ad-hoc filters you apply directly within a specific report to drill down into your data. For example, you might create a temporary report filter to see data for just mobile users, or just for visitors from a specific marketing campaign. This doesn't change your underlying dataset, it just changes your view of it for that moment.
Think of it this way: a Data Filter is like putting a screen over a drain to permanently keep large debris out. A Report Filter is like using a magnifying glass to temporarily examine a small part of what's already in the sink.
How to Exclude Internal & Developer Traffic (Data Filters)
Getting clean, customer-focused data should be your top priority. Your first filtering task in any new GA4 property is to exclude internal traffic from your office, your home, and any of your developers or contractors. This is a two-step process in GA4.
Step 1: Define Your Internal Traffic
First, you need to tell Google Analytics which IP addresses belong to you. An IP address is a unique string of numbers that identifies a device on the internet.
- Navigate to the Admin section by clicking the gear icon in the bottom-left corner.
- In the Property column, click on Data Streams and select your web data stream.
- Under Google tag, click on Configure tag settings.
- On the next screen, you might have to click Show all to see all options. Find and click Define internal traffic.
- Click the Create button.
- Give your rule a clear name, like "Office IP Address" or "Home Office." The traffic_type parameter value is
internalby default, and you should leave it that way. - Under IP address, select a Match type. If you are blocking a single IP, choose "IP address equals." If you have a range, you can use options like "IP address begins with" or "IP address is in range (CIDR notation)."
- Enter the IP address. You can find your current IP by simply Googling "what is my IP address."
- Click Create in the top-right corner. You can repeat this process to add multiple IP locations.
Step 2: Activate the Data Filter
Just defining your IP address doesn't do anything yet. You now have to tell GA4 to actively filter out any data associated with it.
- Go back to Admin.
- In the Property column, under Data settings, click Data Filters.
- You will see a pre-made filter called "Internal Traffic." Click the three dots on the right side of that row and click Activate filter.
- A confirmation screen will appear. Click Activate.
The status will now change to "Active." From this point forward, GA4 will exclude all traffic matching your IP rules. Importantly, this filter does not apply retroactively, it only affects data from the moment you activate it.
You can also use the "Testing" mode for data filters first. This allows the filter to process the data and apply a dimension called "Test data filter name," so you can verify it's working as expected before permanently excluding the data.
Using Ad-Hoc Report Filters for Quick Analysis
While Data Filters are for permanent exclusions, most of your day-to-day filtering will happen directly inside your reports. This lets you drill down on-the-fly to answer specific questions like, "How did our campaign perform in Canada?" or "Are mobile users engaging with our content?"
Let's walk through an example. Say you want to see report data for just Canadian visitors.
- Open a standard report, such as the Traffic acquisition report (under Reports > Acquisition).
- At the top of the report, look for the Add filter + button, right below the report title.
- A panel will slide out on the right where you can build your filter. It consists of three parts:
- Click the blue Apply button.
The entire report will instantly update to show you data - sessions, users, conversions - for only traffic that originated from Canada. A small filter icon pill will appear at the top of the report, reminding you that a filter is active. You can click the 'x' on that pill to remove the filter at any time.
Comparing Segments Side-by-Side
Sometimes you don't want to just filter down to one segment - you want to compare two or three segments against each other. GA4's "Comparisons" feature is built for exactly this purpose.
Let's compare traffic from mobile devices vs. desktop devices.
- In a report, click the Edit comparisons button at the very top (it looks like a little graph icon).
- The view will now show "All Users" by default. Click + Add new comparison.
- Just like a filter, you can now build a set of conditions. We'll set this up to define a mobile audience.
- For the Dimension, find and select Device category.
- For the Value, select mobile.
- Click Apply.
- Now, build a second comparison for desktop. Create another new comparison, select Device category as the dimension again, and choose desktop as the value.
- Click Apply.
Your report will now be presented in a multichannel view, with distinct colors representing each segment (All Users, Mobile, and Desktop). This is a fantastic way to quickly spot differences in behavior, like whether mobile users have a higher engagement rate or desktop users are responsible for more purchases.
Advanced Filtering with Segments in Explorations
For the greatest filtering power and flexibility in GA4, you need to use the Explore section. Explorations allow you to build custom reports, and a core part of that process is creating "Segments." A segment is simply a highly specific subset of your users, sessions, or events.
Imagine you want to analyze the behavior of just users who came to your site from organic search and landed on one of your blog pages. This is the perfect use case for a segment.
How to Build a Segment in an Exploration:
- Navigate to Explore in the left-hand navigation and start a new Free-form exploration.
- In the first column, labeled "Variables," find the Segments section and click the plus icon (+).
- You have three choices: User segment (looks at all activity from users who meet the criteria), Session segment (looks at activity within sessions that meet the criteria), or Event segment (looks at only the specific events that meet the criteria). Let's choose Session segment for this example.
- Give your segment a clear name, like "Organic Blog Traffic."
- Under "Include sessions when:", set up your conditions.
- The summary pane on the right will show you what percentage of your total sessions this segment represents. If it looks correct, click Save and Apply in the top right.
Your Exploration report is now filtered to show data only for sessions that started from Google and landed on a blog post. You can drag and drop different metrics (like Engaged sessions or Conversions) and dimensions (like Page path or Device category) into the report to dig deeper into this specific audience's behavior. This is far more powerful and customizable than the filters in standard reports.
Final Thoughts
Filtering is the key to turning the immense volume of raw data in Google Analytics 4 into clear, actionable insights. By learning how to permanently exclude noisy internal traffic with Data Filters and how to temporarily focus your analysis with Report Filters, Comparisons, and Exploration Segments, you can find the specific answers you need to grow your business.
As powerful as GA4 is, bouncing between different reports and constantly rebuilding filters can be a chore. We built Graphed to simplify this entire process. Instead of navigating several menus to filter by country and device, you can just ask in plain English: "Show me a chart of website sessions from mobile users in the United States last month." Graphed instantly connects to your Google Analytics data and builds a real-time dashboard to answer your question, helping you get insights in seconds, not hours.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.