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

Excluding internal IP traffic & anonymize IP

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

We are trying to exclude internal traffic by adding IP filters to Google Analytics view.

 

We set 2 Predefined filters:

- Exclude; traffic from IP address; equals; 62.225.129.64

- Exclude; traffic from IP address; equals; 62.225.129.65

They do not seem to work correctly.

 

The Google Analytics code in our webpage includes "anonymizeIP" = "true".

 

We have 2 questions:

a) Does anonymizeIP configuration affect these filters?

b) Have we correctly written the filters?

 

Thanks for your attention and support.

 

Best regards,

 

Gorka Garay

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Gorka G
January 2017

Excluding internal IP traffic & anonymize IP

Top Contributor
# 2
Top Contributor

Hi :-)
When you use anonymize IP it blocks out the last octet of the IP address
You can still filter IPs but you'd need to use a regex that will filter out the whole last octet. 
so, you wont just be filtering 62.225.129.64|65 but all IPs that begin with 62.225.129.

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

Marked as Best Answer.
Solution
Accepted by topic author Gorka G
January 2017

Excluding internal IP traffic & anonymize IP

Top Contributor
# 2
Top Contributor

Hi :-)
When you use anonymize IP it blocks out the last octet of the IP address
You can still filter IPs but you'd need to use a regex that will filter out the whole last octet. 
so, you wont just be filtering 62.225.129.64|65 but all IPs that begin with 62.225.129.

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

Excluding internal IP traffic & anonymize IP

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thank you very much, Bronwyn. We modified the filter definition and everything seems to work fine now.

 

 

Excluding internal IP traffic & anonymize IP

N/A
# 4
N/A

Hi, i've the same problem too. :-)

 

If i use filter of the example i exclude all the ip adress  from 62.225.129.001 to 62.225.129.999 is true?

 

When i active the new filter  this affect only the future date tracked or even the past date?

 

Re: Excluding internal IP traffic & anonymize IP

Top Contributor
# 5
Top Contributor

Filters are not retroactive, they do not affect past data.
Always follow best practice and leave the initial default View without any filters applied to it,

this will ensure you have an unedited copy of reported data from the time of installation,

should you need it for reporting purposes, and also helps to prevent data loss from incorrectly

configured filters.

 

If you want to exclude a range 62.225.129.000 to 62.225.129.255 based on the last octet then you could use something like

 

Link to filter screenshot

https://drive.google.com/file/d/0B2HZe_ztYK_fcnI2RUdmb2ZYajA/view?usp=sharing

 

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

Excluding internal IP traffic & anonymize IP

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Won't this potentially be filtering out legit traffic that you don't intend if you replace the last octet with 0? I'd recommended instead updating the GA JavaScript code and set anonymizeIP = false.

Excluding internal IP traffic & anonymize IP

Follower ✭ ✭ ☆
# 7
Follower ✭ ✭ ☆

@Justin K @Bronwyn V @Yes I think so!

 

After reading I think it works as follow:

1) the last blokck of the IP adres is masked with 000

2) the ip filter is applied, so only whole blokc rangtes of 0-255 can be filtered out.

 

So this is indeed a bad solution.

When Google first applied the IP filters and then masked the IPA adres it just would work fine! (but now its not)

 

Any other solution?

 

Excluding internal IP traffic & anonymize IP

[ Edited ]
Top Contributor
# 8
Top Contributor

@Justin K due to legal/privacy reasons, some sites must anonymize the IP

@Keesjan V I never claimed it to be a good solution. 

Simply stated how it was done and it was mentioned in my initial reply

why its not optimal.

 

There are various other solutions depending on the situation.

Have staff etc opt out of google tracking on each of the devices and browsers they use.

or

create a custom dimension for the property, set it at user level scope.

Setup a page with a modified version of the tracking code to also set the value eg internal

of the custom dimension upon pageview.

Then use the value of the custom dimension to filter.

They will have to visit this page on all browsers and devices that they use, 

and they will have to revisit it each time they clear cookies.

 

Alternatively, if they have to log in to use the site, then set the custom dimension value at login eg internal

Then use the custom dimension value for filtering.

Doing it this way means it will be reset every time they log into the site for whatever device/browser they are using, that way they dont have to remember to visit a particular page to reset if they clear their cookies

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

Excluding internal IP traffic & anonymize IP

Follower ✭ ✭ ☆
# 9
Follower ✭ ✭ ☆

Same problem here, but we need anonymizeIP due to EU regulation. I think the solution is a filter per IP adres or block in Google tag manager. To exclude GA snippet to load. That happens before the GA load, so all internal traffic is excluded upfront. Then GA can use anonymizeIP and do no harm to the filters anymore.

 

 

 

 

Excluding internal IP traffic & anonymize IP

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

That is exactly what I was thinking as well, but how can I set this up?