Regex for Blocking IP address in Google Analytics

This is a frequently asked question about blocking IP addresses in Google Analytics.

Blocking a range of IP addresses

If you have a range of IP addresses that you want to block then use this RegEx in Google Analytics

Example:

216.67.94. 01 - 216.67.94.99

181.69.245.01 - 181.69.245.01

Then you can user

2161\. 67\. 94\. \d*|^181\. 69\. 245\. \d*

The | character in the middle means OR.

GET EXPERT ANALYTICS HELP

Need help making GA4 data work for your business?

Tell us about your tracking or reporting challenge. Optizent can help with GA4 implementation, audits, key events, attribution, and training.

We will use these details to respond to your request. Please do not include passwords, account access, or customer data.

Posted in: GA4