IP filtering from Zaraz triggers

We have recently setup Google Analytics in your Zaraz service and to provide additional privacy assurance to our customers, we have enabled the “Hide Originating IP Address” option.

What we have found now though, is that our internal web traffic is being logged in Analytics, because the filtering to exclude this traffic is based on IP address, but now it doesn’t have visibility of IP’s any longer.

Is there a way to filter out internal traffic, using IP address, from Zaraz? If so, can someone provide instructions?

You can build a trigger that matches your IP address using {{ system.device.ip }} and then using it as a blocking trigger in your actions. It will mean that if the IP matches, no information will be sent to GA.

1 Like

Thanks for your reply. I have setup the trigger and blocking action as you have suggested. I am awaiting the results of some testing to see if that works.

While I wait those results, can you confirm that the regular expression I have used to match a number of IP addresses, so that any of these IPs can be block will be supported (ip addresses have been changed)

(101\.101\.101\.101|202\.202\.202\.202|303\.303\.303\.303)

You don’t really need to wait for any results, you can use debug mode to see if the events are being sent or not: https://developers.cloudflare.com/zaraz/web-api/debug-mode/

Thanks for the debug info, that was really useful.

Seems that the Regex was not working, so I have swapped to list each IP address as a separate trigger and reference all of these in the blocking trigger. This is a pain, but it works.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.