In Piwik log, visitor IP address is my server address


I am using a standard Piwik setup. Been using it for years. I call Piwik via the PHP script instead of the JS so that my BI server domain name doesn’t appear in the page code. I used the exact code on this site. However, I never see the visitor’s IP address, just my server. How can I fix this?

(Matthieu Napoli) #2

My guess is that by default the PHP client will take your server’s IP.

Try calling the setIp($visitorIp) method (PiwikTracker - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3) and passing the IP address of the visitor.


How would I do that? Currently I just have the default JS in my pages.

(Matthieu Napoli) #4

Ah sorry I misinterpreted that part:

I call Piwik via the PHP script instead of the JS

So I guess you are using the proxy to hide the Piwik URL: GitHub - matomo-org/tracker-proxy: HTTP proxy for Piwik's tracker API. This script allows to track websites with Piwik without revealing to your visitors the secret Piwik server URL. ?

If not, can you explain a bit more what you meant?



Yes, I use the proxy to hide it. So, the embedded code calls piwik.php, which I got from the site. I am ok modifying code, but I need a bit more help.


(Matthieu Napoli) #6

After looking into it, the PHP script shouldn’t modify the IP address, so the problem might not come from here.

Are you using a HTTP Proxy? Have a look here: How do I configure Piwik when the server is installed behind a proxy? - Analytics Platform - Matomo


No, no proxy. I am running Wordpress network. I looked at another site I own and the correct IP addresses are shown. I suspect the problem is with Wordpress and the way it handles multiple sites and aliasing domains.


I am having the same problem.
Did you fix the issue?


No, but in my case it has to be the result of something in the Wordpress network setup.