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

Filtering IP addresses shared via a proxy server

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

A large multinational client of mine has offices all across the world. For security purposes, all the internal traffic is sent to a proxy server and then visit their website. The proxy server generates random IPs from time to time so it is difficult to filter using GA console. However, the proxy server shares a x-forwarded-for file which contains the origination IP. However, I don't know what code on GA can extract that x-forwarded-for IP and then exclude that traffic from the GA results. Pls help.

1 Expert replyverified_user
Marked as Best Answer.
Accepted by topic author Vaishakh N
August 2016

Re: Filtering IP addresses shared via a proxy server

Top Contributor
# 2
Top Contributor
Hi, GA code by itself will not be able to 'extract' but if you supply GA code the desired variable value and send it via a Custom Dimension you could then pass it on to GA and use the Custom Dimension value in order to include / exclude traffic.

ga('set', 'dimension1', 'Internal traffic');
// Send the custom dimension value with a pageview hit.
ga('send', 'pageview');

Filter fields for View filters:

Hope it helps.

Kind regards,
Web analyst @