[SOLVED] Same IP on new installation

Hi !

I’m using the PHP tracker for some reason since a while now and I never had any problems.
Since some days, I’m running latest version of Piwik on a Ubuntu server 15.10 and I have a problem:

All of my visitor have the public IP of the server.
The database is on another server.

I tried some solutions as
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST

and I would like to know if you have more solutions !


AFAIK the PHP tracker is using cip parameter to forward the IP address. Please confirm that the token_auth is still valid. It’s required in order to force IP. It may have been changed after password change for given user.

You can remove these. I assume that you don’t have proxy/load balancer there.

Seems I forgot something…

I didn’t use the token_auth on my scripts, that’s probably why it doesn’t work.

This my piwik code:

$actual_link = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
PiwikTracker::$URL = 'piwik_url';
$idSite = 1;
$piwikTracker = new PiwikTracker($idSite);
$piwikTracker->doTrackPageView(substr($url_info["path"], 1));

I’m looking at Auth - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3 right now but I didn’t found yet how to implant the auth inside it. Any tips ?


Set IP via setIp() to $_SERVER['REMOTE_ADDR'] and token auth via setTokenAuth(). See also PiwikTracker - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

It finally worked !

Thank you quba, I really apprecited your help :slight_smile: