Filtering the internal website visits from you and your team from Google Analytics will keep your data cleaner, and will prevent your sessions from diluting your conversion/engagement metrics. This will provide a more accurate representation of your website’s actual performance and will improve the overall analysis.

Quick Links:

How To Filter Your IP From Google Analytics

IP Filters can be applied in the Filter Settings of the View in your Google Analytics Account. You can use a pre-defined filter type to Exclude traffic from the IP Address that equals your IP Address. Moving forward, traffic from that IP Address will be filtered out.

Keep reading for more detailed instructions and specific use cases, such as filtering multiple IPs and IP Ranges.

Filter A Single IP Address From Google Analytics

Use the image below as an example, or follow each of the steps to ensure you’re getting the IP filter set up correctly.

Single IP Filter Steps

Step 1: Find Your IP Address

my ip address

Finding your IP address is easy – just go to https://www.whatsmyip.org/. Copy that number down, as you’ll be using it in the filter. If you work at a larger company, reach out to your IT Team or your company “computer guy.” If they give you multiple IPs or a range of IPs, scroll down and you’ll be able to see specific setup instructions.

Step 2: Open Filters In Your Google Analytics Admin

Navigate to your Google Analytics Admin screen, by clicking “Admin” in the lower-left corner of any Google Analytics Report. Then click “Filters” in the rightmost column under the main View used for reporting in your account.

Step 3: Click The Red +’Add Filter’ Button To Start Your Filter

add filter button

Click the add filter button to create a new filter.

Step 4: Name Your Filter Something Meaningful

name your filter to exclude

For any filter that is excluding traffic, I always start the name with “Exclude – ” and then follow it with something that clearly tells me what is being filtered out. In the above example, I can clearly tell that “Ryan’s IP” is being filtered out. Naming things clearly in Analytics will help you stay organized and avoid headaches in the future.

Step 5: Use A Predefined Filter to Exclude Traffic From IPs That Equal

predefined filter to exclude ips that equal

Select the “Predefined” box to show the correct drop-downs on the filter, and then select the following options. Exclude, “traffic from the IP addresses,” that “are equal to. “

Step 6: Paste In Your IP Address

my ip address in GA

Paste your IP Address from Step 1 in the box, and ensure there are not any spaces before/after the text.

Step 7: Save The Filter To Start Filtering Your Visits

save the ip filter

Click the blue “Save” button to start filtering visits from that IP address. It’s always helpful to annotate this in Google Analytics, as you’ll easily be able to identify when this IP filter was added.

What If My IP Doesn’t Look Like That? (IPv4 & IPv6 Filters)

An IPv4 Address looks like 68.123.45.76

An IPv6 Address looks like 2604:2100:f1c4:6a00:6407:f333:5cd6:eeff

To filter an IPv6 Address in Google Analytics, you can use the exact same instructions for filtering a single IP above. The multiple IP instructions lower on this page will also work.

Don’t combine both address types in the same filter, as the filters should contain only IPv4 or only IPv6 addresses. Break them out into 2 or more filters.

How Can I Verify My IP Filter Is Working?

With most filters, you can click the “verify filter” link at the bottom of the filter editor. This will let you know how data from the last 7 days would have been impacted had the filter been applied. However, the IP Filters don’t offer this function, and there isn’t a clean way to test the IP Filter is working immediately.

The best way to verify your IP filter is working is to add the filter and then check the data after a few days. If you’re able to identify yourself based on your location or certain actions taken on the site, you should see that traffic stop.

The Real-Time Reports are not a reliable way to test IP Filters. You may show up in those reports, even though your interactions will later be filled out in the main reports.

Setting Up Filters For Multiple IP Addresses

Setting up a different filter for each IP address is the most straight forward way to filter out multiple IPs. While this easily works for 2-3 IPs, it quickly becomes unmanageable with the more IPs added.

To filter out multiple IP addresses in a single filter, regular expressions can be leveraged. This can allow you to quickly filter out a list of unique IPs, or filter out entire ranges of IPs. Follow the steps below to start filtering out your list of IPs.

Quick Introduction To RegEx To Filter Multiple IPs

Regular Expressions, or RegEx for short, are used as a way of matching different items. If I wanted to create a filter to match IP1 and IP2, I would enter “IP1|IP2” – with the vertical bar “|” in between. This bar means “OR” so my RegEx phrase means “Match IP1 OR IP2,” which is exactly the goal of the filter.

To combine multiple IPs, just put the vertical bar between them: 123.456.78|910.234.12

The period in RegEx means “any character,” which means the periods found in IP addresses could technically match something other than our IPs. To stick with best practices and to ensure only the intended IPs are matched, we can use a “\” to make the period only match periods.

The proper way to write an IP in RegEx is 123\.456\.78

The above example with combined IPs would look like 123\.456\.78|910\.234\.12

I highly recommend learning more about RegEx here – https://regexone.com/

How To Filter Multiple IPs From Google Analytics

Use the image below as an example, or follow each of the steps to ensure you’re getting the IP filter set up correctly.

Multiple IP Filter Steps

Step 1: Find Your List Of IP Addresses

list of multiple ips

To put together your list of IPs, send everyone with a unique IP to https://www.whatsmyip.org/ and have them send back their IP address. Copy those numbers into a notepad file, as you’ll need to reference them later. You can also reach out to your development/technology department for a list of IPs.

Step 2: Modify Your IPs To Match The RegEx

list of ips for regex filter

Put a slash “\” before every period, and put a vertical bar between every IP address. There should not be a bar on the end, and there should not be any spaces in your text.

Step 3: Open Filters In Your Google Analytics Admin

Navigate to your Google Analytics Admin screen, by clicking “Admin” in the lower-left corner of any Google Analytics Report. Then click “Filters” in the rightmost column under the main View used for reporting in your account.

Step 4: Click The Red +’Add Filter’ Button To Start Your Filter

add filter button

Click the add filter button to create a new filter.

Step 5: Name Your Filter Something Meaningful

exclude team ips

For any filter that is excluding traffic, I always start the name with “Exclude – ” and then follow it with something that clearly tells me what is being filtered out. In the above example, I can clearly tell that my “Team IPs” are being filtered out. Naming things clearly in Analytics will help you stay organized and avoid headaches in the future.

Step 6: Use A Custom Filter to Exclude IP Addresses

Select “Custom” as the filter type and then select “IP Address” from the drop-down under the Exclude section. I believe the Predefined filter type will also accept RegEx, but I’ve been using the Custom Filter Type for years without any issue.

Step 7: Paste In The RegEx IPs

the regex ip filter

Paste in the full list of IPs from Step 2 in to the Filter Pattern field. Double check there are not any spaces before/after the text. This field will also accept more advanced RegEx, in case you are blocking on ranges of IPs or using more advanced matching.

Step 8: Save The Filter To Start Filtering Your Visits

save the ip filter

Click the blue “Save” button to start filtering visits from that IP address. It’s always helpful to annotate this in Google Analytics, as you’ll easily be able to identify when this IP filter was added.

How To Filter Out Ranges Of IPs

Using more advanced RegEx, you can block entire ranges of IPs. It’s common at larger companies to have their network across a range of IPs, where the first portion of the IP is the same and only the last few digits change.

An example range 68.123.45. [0-255], meaning they have 256 IP Addresses that all start with 68.123.45

In this case, you have a few potential options:

As you can see RegEx can become very complicated, very quickly. I recommend taking the free RegEx course at https://regexone.com/, and then checking all of your RegEx using https://regex101.com/. This site will let you paste in a list of IPs and test your RegEx against the list – so you can ensure everything is matched.

IP Filter FAQs

What’s Next?

I hope you learned everything you wanted to know about IP filters in Google Analytics! Reach out in the comments below if you have any questions, find any errors, or want me to expand on anything. Thank you!