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
Using doTrackPageView() with the PiwikTracker PHP API records server IP instead of client IP. #10920
Comments
I've checked the classes source and my PiwikTracker object $tracker. |
REMOTE_ADDR is typically set to the client address. if not, it may be you are using proxies or other configuration where IP is set in another header. you can see which IP to use by looking at the output of |
You seem to have misunderstood. I also tinkered with the proxy settings in the Piwik config like your issue resolving readme suggests, nothing changed. I also used |
it should definitely work if you call setTokenAuth and pass a token with admin access to the given website in piwik. If it still does not for you, you can debug the tracking api requests see here: http://developer.piwik.org/api-reference/tracking-api#debugging-the-tracker |
I found the issue, I leave this here for future reference.
Almost everything worked like intended, The help on this suggested to find the client IP in your
This resulted again in Piwik recording the server IP. Which is odd, given the next step and solution. Then I went back to the first code without setTokenAuth() and enabled debugging and saw that Piwik reports that the request lacks the rights to record CID, which equaled the client IP. So, lastly I did this:
This now properly records the client IP in Piwik. Unfortunately the documentation in [1] nowhere states that setTokenAuth() is required for this to work. Alternatively there's a bug that requires regular tracking to have admin rights. [1] https://piwik.org/docs/tracking-api/#tracking-api-reference |
Thanks for the details @mahammer - I've added a call to |
I am new to piwik so I am not sure if this is a bug, issue or feature.
However piwik records the server IP instead of the visitors IP. I am aware that I could use ->setIP() but then I need to auth() for what I read.
Is recording the server IP a bug or intended?
The text was updated successfully, but these errors were encountered: