Unique ID and Cookies when Accessing trought the PHP API

Hello,

I generate the Statistics with the PHP API, not with the Javascript method.

Here is my code:


require_once('PiwikTracker.php');
PiwikTracker::$URL = 'http://stats.mydomain.com/';
$track = new PiwikTracker( $idSite = 1);
$track->setTokenAuth('mytoken');
$track->setUrl('http://api.mydomain.com/testurl');
$track->doTrackPageView('test');

I’ve analyzed the request and I detected that piwik doesn’t add a Cookie to the Document.
Is it my job to implement the uiniqueID with php and set the cookies manually with setVisitorId ?

Thanks

Currently the tracker doesnt set cookies onyl reads them if they exist. It’s on the todo list and you can submit a clean patch if possible :slight_smile: thanks