How to Create a New Filter in Google Analytics
A messy Google Analytics account makes it impossible to find real insights about your traffic. Filters are your first line of defense, cleaning your data so you can trust your reports and make smarter decisions. This guide will walk you through exactly how to set up and manage filters in Google Analytics, step-by-step.
First, A Quick Word on Why Filters Matter
Google Analytics filters are rules that include, exclude, or modify the data in a specific reporting View before it's processed and saved. Think of it as a gatekeeper for your reports. Once data passes through and is processed, those changes are permanent for that View. You can't go back and "un-filter" past data.
This is why understanding them is so important. When used correctly, filters help you:
- Exclude internal traffic: Stop your own team's visits from inflating your traffic metrics.
- Block spam traffic: Remove fake referrals and ghost traffic from bots skewing your data.
- Focus on specific subdirectories: Create a view that only shows traffic to a specific part of your site, like
\/blogor\/shop. - Clean up messy URLs: Make your reports cleaner by forcing all URLs to be lowercase, removing query parameters, and more.
By filtering out the noise, you get a much more accurate picture of how real users are interacting with your site.
Best Practice: Never Filter Your Primary View
Before you create a single filter, you need to set up your account correctly to avoid permanent mistakes. Because filtering data is a destructive action (you can't undo it), you should never apply filters to your one and only "All Web Site Data" View.
The standard best practice is to maintain at least three separate Views for each website Property:
- Raw Data View: This is your backup. It remains completely unfiltered. No filters, no goals, no changes. Ever. If you make a mistake elsewhere, you still have this pure, untouched data set to troubleshoot with.
- Test View: This is your sandbox. Before applying a new filter to your main reporting view, you apply it here first to make sure it works as expected without breaking anything.
- Master View (or Main Reporting View): This view gets your tested, verified filters. It's the clean, trustworthy view you use for all your daily analysis and reporting.
How to Create a New View
If you only have the default "All Web Site Data" view, here’s how to create new ones for testing and reporting:
- Navigate to the Admin section (click the gear icon in the bottom-left corner).
- In the far-right "View" column, click the dropdown menu at the top.
- Select Create View.
- Give your new view a descriptive name, like "Master Reporting View" or "Test View - Filters".
- Set the correct Reporting Time Zone.
- Click Create View.
Repeat this process so you have your Raw, Test, and Master views ready to go. From now on, you'll apply new filters to your Test View first, then your Master View.
How to Create a New Filter in Google Analytics: Step-by-Step
Ready to create your first filter? Let's say we want to exclude traffic from your home or office so your own pageviews aren't counted. All the action happens in the Admin panel.
- Go to Admin > View column. Make sure you have selected your Test View from the dropdown.
- Under the View column, click on Filters.
- Click the red + Add Filter button.
- Give your filter a descriptive name. This is important for telling your filters apart later. Something like "Exclude Office IP Traffic" works perfectly.
- Under Filter Type, choose between Predefined or Custom. For excluding an IP address, Predefined works fine.
- Select a filter type from the dropdown menus. In this case, it will be: Exclude > traffic from the IP addresses > that are equal to.
- In the IP address field, enter your IP address. (Don't know it? Just google "what is my IP address").
- Click the Save button at the bottom.
That's it! Traffic from that IP address will now be excluded from this view moving forward. Once you let it run for a day or two and confirm it's working on your Test View, you can repeat the process to add it to your Master View.
5 Essential Filters You Should Create Today
Excluding your IP address is just the beginning. To truly clean up your data, you should have a few key filters running. Here are five of the most useful ones with instructions for setting them up.
1. Excluding Internal IP Traffic
As covered above, this is the most fundamental filter. It prevents you, your employees, and any freelancers from artificially inflating your session and user counts.
- Filter Name: Exclude Office IP
- Filter Type: Predefined
- Configuration: Exclude > traffic from the IP addresses > that are equal to
- IP address: [Your IP Address]
2. Exposing Full Domain in Page Reports
By default, GA reports show the page path (e.g., /contact-us) but not the hostname (e.g., www.example.com). If you have activity on multiple subdomains (like blog.example.com and shop.example.com), this filter combines them into a single URL in your reports (e.g., blog.example.com\/blog-post-title).
- Filter Name: Prepend Hostname to Request URI
- Filter Type: Custom > Advanced
- Field A -> Extract A: Hostname (select from dropdown), with the value
(.*) - Field B -> Extract B: Request URI (select from dropdown), with the value
(.*) - Output To -> Constructor: Request URI (select from dropdown), with the value
$A1$B1 - Make sure to check "Field A Required" and "Override Output Field".
3. Forcing All URLs to Lowercase
Google Analytics is case-sensitive. This means it sees /Blog, /blog, and /BLOG as three different pages, which splits your data and messes up your reports. This simple filter forces everything to lowercase, unifying your page data.
- Filter Name: Force Lowercase on URLs
- Filter Type: Custom > Lowercase
- Filter Field: Request URI (select from dropdown)
You can create similar lowercase filters for "Campaign Medium," "Campaign Source," and "Campaign Term" to keep your UTM parameters nice and tidy, too.
4. Including only Traffic to a Specific Subdomain
What if you only want to see data for one part of your site, like your blog? You can create a new View and apply a filter to only include traffic where the hostname is blog.yourwebsite.com.
- Filter Name: Include Only blog.yourwebsite.com
- Filter Type: Predefined
- Configuration: Include only > traffic to the hostname > that are equal to
- Hostname: blog.yourwebsite.com
5. Excluding Development or Staging Site Traffic
If your developers are working on staging.yourwebsite.com and using the same GA tag as your live site, all that test traffic is polluting your data. You can easily exclude it.
- Filter Name: Exclude Staging Environment
- Filter Type: Custom > Exclude
- Filter Field: Hostname (select from dropdown)
- Filter Pattern:
staging\.yourwebsite\.com(you may need to tweak the pattern slightly depending on your exact URL structure).
Applying and Verifying a Filter
After you configure a filter, you have a chance to see how it might affect your data before saving. At the bottom of the filter creation page, you'll see a link that says "Verify this filter".
Clicking this will show a "before and after" table based on a small sample of your data from the last 7 days. This quick check helps you confirm that your filter pattern is correct and isn't accidentally filtering out more data than you intended. It's a handy safety mechanism, especially for more complex filters using regular expressions.
Filter Order Matters
If you have multiple filters applied to a single view, Google Analytics applies them in the order they are listed. For example, if your first filter is an Include Only filter for your blog subdomain, and your second filter is an Exclude for your office IP, the order is crucial. Both rules must be true for the data to be processed.
You can change the processing order from the primary filter page by clicking "Assign Filter Order." Just drag and drop them into the sequence needed and click save.
Final Thoughts
Taking the time to set up these fundamental Google Analytics filters is one of the highest-impact things you can do for your data hygiene. It turns a cluttered, noisy account into a source of truth, giving you the confidence that your strategic decisions are based on accurate performance data.
We know that managing Views and setting up filters can feel like a chore that stands between you and the answers you need. At Graphed, we remove that friction by connecting directly to your marketing and sales data sources - including Google Analytics. There's no need to manually craft exclude filters or worry about staging site data, you can just ask in plain English for a report on last month's campaign performance, and we'll instantly generate the dashboards you need to see what's actually working.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?