AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
2K members online now
2K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Excluding multiple IP ranges with regular expression

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there,

I set up the Google Analytics environment for a client of mine with multiple IP addresses. I created three filters for the following range of IP addresses.

14.141.92.81 - 14.141.92.95 --- (^14\.141\.92\.(8[1-9]|9[0-5])
182.71.0.129 - 182.71.0.143  --- (^182\.71\.0\.(1(29|3[0-9]|4[0-3]))
14.141.157.209 - 14.141.157.224 --- (^14\.141\.157\.(2(09|1[0-9]|2[0-4]))

 

I am getting not all but some amount of data daily from different the above IPs. Randomly some few IPs are being tracked.

Please let me know whether these expressions are correct. If not then please help me to generate correct filters for these IPs.

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Mohan Lal S
July 2017

Excluding multiple IP ranges with regular expression

Top Contributor
# 6
Top Contributor

Hi :-)

For clarity, I usually use seperate exclude filters for each IP range.
Bare in mind too, an IP regex must be used with a custom exclude filter, they cannot be used 

with the predefined filters.

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

View solution in original post

Excluding multiple IP ranges with regular expression

Top Contributor
# 2
Top Contributor

Hi :-)

almost there.. 

 

^14\.141\.92\.(8[1-9]|9[0-5])$

^182\.71\.0\.(1(29|3[0-9]|4[0-3]))$

^14\.141\.157\.(2(09|1[0-9]|2[0-4]))$

 

Handy free online tool here for creating regex's for IP ranges

http://www.analyticsmarket.com/freetools/ipregex

 

Bare in mind too, 

1) Always follow best practices and keep your initial default View without filters applied.

2) If you are applying filters to a View that contains historical data, filters are not retroactive,

and will only start to remove traffic going forward from when they are applied

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Excluding multiple IP ranges with regular expression

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks Bronwyn V,

 

I have used the same tool but when I cross checked this with ipregexpal it shows ip not match. And when I remove the $ sign IPs are matched.

Please let me know whether I should use $ sign at the end of all three filters?

Or should I create one filter for all these three above IP ranges.

Excluding multiple IP ranges with regular expression

Top Contributor
# 4
Top Contributor

I've been using the analyticsmarket.com IP regex tool on the linked page for quite some time now and never had an issue with it.

What you can do is create a new View just for testing..apply the IP filters to that so you can watch the results over a couple of days before then deciding if you want to apply the filters to a main reporting View or not.

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Excluding multiple IP ranges with regular expression

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Thanks Bronwyn V,

 

Thanks for responding.

 

My concern is whether I should use $ at the end of every filter or should combine all filters into one with the help of $?

 

Marked as Best Answer.
Solution
Accepted by topic author Mohan Lal S
July 2017

Excluding multiple IP ranges with regular expression

Top Contributor
# 6
Top Contributor

Hi :-)

For clarity, I usually use seperate exclude filters for each IP range.
Bare in mind too, an IP regex must be used with a custom exclude filter, they cannot be used 

with the predefined filters.

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here