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

Problem with ip adress , if use php api #7340

Closed
Alex-query opened this issue Mar 3, 2015 · 1 comment
Closed

Problem with ip adress , if use php api #7340

Alex-query opened this issue Mar 3, 2015 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@Alex-query
Copy link

require_once "PiwikTracker.php";
$ip=$_SERVER['REMOTE_ADDR'];
PiwikTracker::$URL = 'http://url/piwik/';
$piwikTracker = new PiwikTracker(1);
$piwikTracker->setIp($ip);
My solution, it`s in file IP.php en function getIpFromHeader() add line $default = $_GET['cip'];

@mattab
Copy link
Member

mattab commented Mar 3, 2015

Hi @Alex-query,

When you use setIp you must also use setTokenAuth and then it will work.

This is explained in: http://developer.piwik.org/api-reference/PHP-Piwik-Tracker#setip

@mattab mattab closed this as completed Mar 3, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Mar 3, 2015
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

3 participants