Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking HTTP API: Server IP is tracked instead of user IP #10581

Closed
SDPrio opened this issue Sep 27, 2016 · 1 comment
Closed

Tracking HTTP API: Server IP is tracked instead of user IP #10581

SDPrio opened this issue Sep 27, 2016 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@SDPrio
Copy link

SDPrio commented Sep 27, 2016

Hi,

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.

I added a echo statement to output the URL that is used by the Clients sendRequestsendRequest(...) method:

URL3: https://piwik.example.com/piwik.php?idsite=1&rec=1&apiv=1&r=177493&cip=56.71.16.47&_idts=...

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

@mattab
Copy link
Member

mattab commented Sep 27, 2016

Hello @SDPrio
you need to call setTokenAuth to set your token as setting a custom IP address requires a token auth, as documented in http://developer.piwik.org/api-reference/tracking-api

@mattab mattab closed this as completed Sep 27, 2016
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants