Google\'s detection of Unusual traffic is nice. But how is it handling Dynamic IP addresses?
For example,I do not have ranges of IPs and my ISP provides Dynamic IP which
Give the Ghostery browser extension a try:
https://www.ghostery.com/
It's easy to define which scripts you want to block per domain. As a bonus, the extension shows which tracking scripts are loaded while you browse the web.
We had the task to exclude a whole company from Analytics. The internet router got IP renewed circa once a day. Turned out that this router like nearly all common routers nowadays offered some options to enable dynamic IP services. Like noip.com for example.
And what happens now is, that the router everyday automatically pushes its new IP to noip.com, where it gets associated to the domain name you registered before. Now on your page you can dynamically check that domain's IP and if it matches the client's (browser's) IP you exclude the Analytics scripts from being printed to the page.
In my case I was on PHP and something along the lines of the following snippet worked out fine. See gethostbyname().
$print_tracking_scripts = TRUE;
if (gethostbyname('my-unique-name.ddns.net') === $_SERVER['REMOTE_ADDR']) {
$print_tracking_scripts = FALSE;
}
if ($print_tracking_scripts) {
// Print or include tracking scripts however you like.
}
Why not simple add a filter:
For example for IP ranging from 182.73.42.140 to 182.73.42.150 The regex would be:
^182.73.42.(1(4[6-9]|50))$
Here's a screenshot for same
If you have trouble understanding RegEx, you may use this tool to create IP range regex