How to exclude my IP in Matomo PHP tracker?


(Amrita) #1

I am using Matomo PHP tracker. When I go to Personal Settings and try to exclude my visits using a cookie, my PHP tracker does not honor the cookie and keeps tracking my visit. Do I need to make any function call in the PHP tracker to read the cookie and exclude my visits ? Can someone give me a sample code for that ?


(Lukas Winkler) #2

As you are writing the PHP code, you can simply only execute the Matomo tracker if the IP is not yours:


if ($_SERVER['REMOTE_ADDR'] != "192.168.0.1") {
    your_matomo_tracker()
}

(Amrita) #3

Yes, that would work perfectly. Thanks.