I am interesting in PHP Tracking API too.
But information about PHP Tracking is not understood.
The docs don’t have real working example how to use PHP Tracking API (HTTP Request ) as Javascript Tracking.
Javascript Tracking is easy - we copy code an insert to every page which we want track. And it working! All information collected in database (ip, referrers, provider and other).
But PHP Tracking (HTTP Request ) - don’t working properly.
What information provide doc for users?
Upload PiwikTracker.php and add for first add php for API init:
require_once “/path/to/PiwikTracker.php”;
PiwikTracker::$URL = ‘http://our_piwik_server.com/’;
It’s prefect, all understand.
For HTTP Request Method:
a) $piwikTracker = new PiwikTracker( $idSite = {$IDSITE} );
b) // Sends Tracker request via http
$piwikTracker->doTrackPageView(‘Document title of current page view’);
WHY??? Why we must manually add Document Title?
In Javascript we correct manually Page Title? NOT! Script check Title, Referrers, ip and etc…
Why in Php Tracking we must add title? Php script must check self $_SERVER[‘HTTP_REFERER’], $_SERVER[‘REMOTE_ADDR’] and other parameters.
The document title is not available in PHP as it is part of the HTML DOM tree so you have to set a fake document title (you can also set ‘’ empty string)