Symfony + Tracking HTTP API: Server IP is tracked instead of user IP


I have integrated the Tracking HTTP API using the PHP Client into my Symfony 2.7 WebApp.

To track a page view I simply call clients doTrackPageView($documentTitle) method from within the page controllers. This works fine with one problem: All page views are tracked with the IP of the WepApp server instead of the users IP.

On the one hand the problem is obvious: The WebApp Server sends the tracking information via HTTP to Piwik. Thus the HTTP call to Piwik uses the servers IP address. On the other hand all other information (Page title, URL, etc.) are used from the users HTTP request.

Is this a bug or a feature? Is there any setting I have to change to track the users IP instead?

Have you looked at the FAQ topic?

Yes, I do know this FAQ topic. I should have mentioned this, sorry.

However the topic does not solve the problem. I added a echo statement to output the URL that is used by the Clients sendRequestsendRequest(...) method:


This is the same, no matter if call use $this->tracker->setIP($_SERVER['REMOTE_ADDR']) or not. The URL transfers the correct IP ( but piwik tracks the server IP instead.

Sounds like a possible bug in the Piwik code. File a bug report.