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

I can't filter out multiple IP addresses with a regular expression

[ Edited ]
ACG
Follower ✭ ✭ ✭
# 1
ACG
Follower ✭ ✭ ✭

Hi all,

 

I've been trying to exclude a few IP addresses for some days and I've not managed so finally I've decided to ask here.

 

I've been given six IP addresses that look more or less like this: XXX.XXX.XXX.XX/XX 

 

I've tried to exclude everything including the /XX using \ symbol before the forward slash, I've tried without the last bit /XX. I've tried with ^ and $ at the beginning and end and it hasn't worked. I'm separating each IP address all the time. I've asked IT and they say the IP addresses are public but when I ask Google for my IP address this doesn't match any of the IP addresses I've been given. Could it be that I have a dynamic IP address?

 

I'm using Custom Filter > Exclude > Filter field IP address on Google Analytics. 

 

Can anyone help please? I ran out of ideas... By best bet has been ^XXX\.XXX\.XXX\.XX$|^XXX\.XXX\.XXX\.XX$ and so on but it's not working...

 

Thanks and Regards, A.

1 Expert replyverified_user

Re: I can't filter out multiple IP addresses with a regular expression

Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭
Hi ACG,
I'm sharing a tool for this please check.

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

Hope this helps.

Thanks

Re: I can't filter out multiple IP addresses with a regular expression

ACG
Follower ✭ ✭ ✭
# 3
ACG
Follower ✭ ✭ ✭
Hi,

Thanks for your reply. I'd rather not use this tool because I have more than two IP addresses and it looks like it might exclude traffic from addresses that they are not ours. Also I'd like to understand how to do it so next time I can do it myself Smiley Happy

Thanks and Regards, A

Re: I can't filter out multiple IP addresses with a regular expression

Participant ✭ ✭ ✭
# 4
Participant ✭ ✭ ✭

Re: I can't filter out multiple IP addresses with a regular expression

ACG
Follower ✭ ✭ ✭
# 5
ACG
Follower ✭ ✭ ✭
Read it, tried and didn't work. Let's see what others say... thanks! A.

Re: I can't filter out multiple IP addresses with a regular expression

Top Contributor
# 6
Top Contributor
Hi ACG,

1) check if you have a dynamic IP (just do a https://www.google.com/#q=whats%20my%20ip&rct=j a few times (reset may be needed))
2) check if your GA tracking uses anonymize IP set to true as in that case the last number is always 0 - e.g. xxx.xxx.xxx.0
3) how long is the regex?
4) create a test view and try adding IP excludes one by one to see if it even triggers anything

Hope it helps.

Kind regards,
Zorin
Web analyst @ escapestudio.net
Marked as Best Answer.
Solution
Accepted by topic author ACG
June 2016

Re: I can't filter out multiple IP addresses with a regular expression

[ Edited ]
ACG
Follower ✭ ✭ ✭
# 7
ACG
Follower ✭ ✭ ✭

Hello,

I think this is sorted now (at least my IP address is filtered out from real time info on GA). The company was actually using a range of IP addresses (XXX.XXX.XXX.XXX/XX).

I spoke to IT and recommended me to use an online IP calculator tool to find out what these ranges were. So I did. Then I created several filters to include many more IP addresses that I initially had (several filters because GA has a max 255 characters per regular expression) and that's it!

Thanks very much for all your contributions Smiley Happy

A.

Re: I can't filter out multiple IP addresses with a regular expression

Follower ✭ ✭ ☆
# 8
Follower ✭ ✭ ☆
Why u didn't exclude a subnet of IP addresses, set up the filter like this:
Filter name: enter a name
Filter type: Predefined
Select filter type: Exclude
Select source or destination: traffic from the IP addresses
Select expression: that begin with
IP address: XXX.XXX.XXX.
?

Re: I can't filter out multiple IP addresses with a regular expression

ACG
Follower ✭ ✭ ✭
# 9
ACG
Follower ✭ ✭ ✭
Hi Vladimir,


The problem was that I had a range of IP addresses on each addresses I was given and I didn't know. I think that now should be sorted though since I have found all the IP addresses through and IP calculator and excluded them in Google analytics.

Thanks, A.