DE

EN

Blog Post

Web analytics

Thorsten

Abrahamczik

published on:

Set filters in Google Analytics

Table of Contents

No table of contents available

Google Analytics is the most popular web analytics tool out there. As a website owner, it lets you understand how users interact with your site so you can take the right steps to optimize it. To make sure you're only seeing relevant data in your reports, setting up specific filters is a great idea.

Why are filters in Google Analytics useful?

By default, Google Analytics collects all visitor data without any filtering. However, using every single data point for your analysis usually isn't 100% helpful.
Filters act like a sieve for your data, ensuring that your reporting view only shows the values you actually need.

Generally, filters can be divided into the following main categories:

  • Include filter: Only data matching a specific filter pattern gets through

  • Exclude filter: Data matching the defined filter pattern is excluded

  • Search & Replace: Rewrites labels captured by Google (e.g., homepage = "/")

  • Lowercase: Reduces duplicate entries by converting all letters to lowercase

A classic reason to set up a filter is to exclude an IP address range. This lets you filter out traffic from your company or agency network if you're using a static IP. The same goes for your IT service provider, who might visit the site frequently using a static IP without it being relevant to your optimization efforts. Note that this filter won't work for dynamic IP addresses, as they change every 24 hours.

Filters can also help block spam and bot traffic to some extent. Many referral URLs known for spamming websites and distorting traffic are already widely documented. You can check the referrers bringing users to your site to spot them. Typically, these show 1 page/session, 0:00 time on page, and a bounce rate near 100%.
To investigate, check the left navigation bar under Acquisition > All Traffic > Referrals for an overview of your referral URLs.

Fig. 1: Viewing referrals in Google Analytics



You can also spot spammy behavior in other Google Analytics reports, such as "Geo / Location", "Site Content", and "All Traffic".

Here's a common example of spam traffic:

Fig. 2: Example of spam traffic



How to exclude your company network's IP address range

If you want to track real user behavior with Google Analytics, traffic from your own network just gets in the way. Internal page views shouldn't be counted alongside genuine visitors browsing your site.

To keep internal traffic out of your reports, set up a filter like this:

First, head over to your Google Analytics account and open the Admin view:

Fig. 3: Admin view in Google Analytics



In the right-hand column under the View settings, you'll see "Filters". Click here to add a new filter.

Now configure the filter. Give it a clear name, choose "Predefined" as the filter type, and select "Exclude". Pick the "that begin with" rule, and enter the start of the IP address you want to exclude in the final field. Avoid using the "that are equal to" rule: for privacy compliance, Google automatically anonymizes the last part (the last 3 digits) of the IP address, meaning the complete number sequence is never received by Analytics.

Fig. 4: Filter for excluding IP addresses

How to exclude referral URLs

If you review your referral URLs and notice traffic coming from bots—skewing your reports with spam—you should create a filter to exclude that data. Start by compiling or looking up a list of these URLs, and then create a custom "Exclude" filter.

Give it a descriptive name and select "Campaign Source" or referral as the filter field. Next, enter your identified URLs into the filter pattern. Separate each URL with a pipe symbol (|). Make sure to place a backslash (\) before EVERY dot so it isn't treated as a wildcard command in regular expressions. Don't use any spaces in the filter pattern.

Keep in mind that Google Analytics limits filter patterns to 255 characters, so you may need to set up multiple filters to block all your unwanted referrers.

Test your filters before going live

Once you save your filters, they start working immediately. However, you can't recover filtered-out data or reverse the filtering process retroactively. That's why we recommend testing new filters in a dedicated test view first before applying them to your live reporting. It's also smart to keep an unfiltered view that captures all raw website data—that way, you can always reference or reconstruct the original numbers if an error occurs.

To learn how to properly set up your views, take a look at our article Google Analytics Basic Configuration – What You Need to Know.



How we can help

Using filters correctly keeps your data clean, giving you meaningful insights from your Google Analytics setup. If you ever need a hand with your web analytics, we'd love to hear from you—feel free to reach out!

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Legal Information

Newsletter

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Legal Information

Newsletter

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Legal Information

Newsletter