@RvMp opened this Issue on June 13th 2016

It seems like when using the PHP API the IP (cip variable) is not correctly parsed in PIWIK (version: 2.16.1). The token is from a user with administrator privileges for that specific site.

Log entry of apache on piwik server

**149.210.175.14** - - [13/Jun/2016:16:58:33 +0200] "GET /piwik.php?
idsite=8&rec=1&apiv=1&r=931302&cip=**80.64.22.145**&token_auth=XXXXXXXXX&_idts=1465819516
&_idvc=48&_id=c2d888b3c72a4775&url=https%3A%2F%2Fwww.example.com%2F&urlref=&action_na
me=Example+%7C+Piwik HTTP/1.1" 200 215 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"

PHP code used

function htmlTitle($data) {
  require "assets/php/piwik-php-tracker.php";
  $t = new \PiwikTracker( 2, 'http://piwik.externaldomain.com');
  $t->setTokenAuth('XXXXXXXXX');
  $t->setIp($_SERVER['REMOTE_ADDR']);
  $t->doTrackPageView("$data");
  return $data;
}

The correct IP is 80.64.22.145 but PIWIK interface shows 149.210.175.14.

@sgiehl commented on June 13th 2016 Member

Does the user (token auth) you are using have admin access for the tracked
website?

@RvMp commented on June 13th 2016

Yes. The token used is from a user with administrator privileges for that specific site.

By the way:
Even without specifically setting the setIp option this problem exists.
Apache log show that the CIP variable is set correctly but PIWIK seems to ignoring it.

@mattab commented on July 8th 2016 Owner

Hi @RvMp

Here is what to do:

@mattab commented on July 14th 2016 Owner

@RvMp please let us know if you can reproduce the issue and the debug output, we'd like to help solve this bug if it's confirmed :+1:

@mattab commented on August 23rd 2016 Owner

As we have not heard from you, closing the issue. Feel free to comment and re-open if you still experience the issue and have more info.

This Issue was closed on August 23rd 2016
Powered by GitHub Issue Mirror