Hello,
Hope someone can help. Searched the website but cant seem find a solution.
Not sure what im doing wrong but ive set up Piwik and its all fine when using the login system. However im now trying to call the Piwik api in PHP and it keeps throwing the error:
Fatal error: Call to undefined function printDebug() in /home/xx/public_html/piwik/core/Tracker/Action.php on line 190
Im using the following code:
define('PIWIK_DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT'] . '/piwik');
define('PIWIK_USER_PATH', $_SERVER['DOCUMENT_ROOT'] . '/piwik');
define('PIWIK_INCLUDE_PATH', $_SERVER['DOCUMENT_ROOT'] . '/piwik');
define('PIWIK_ENABLE_DISPATCH', false);
define('PIWIK_ENABLE_ERROR_HANDLER', false);
define('PIWIK_ENABLE_SESSION_START', false);
require_once(PIWIK_INCLUDE_PATH . "/libs/upgradephp/upgrade.php" );
require_once(PIWIK_INCLUDE_PATH . "/core/Loader.php" );
require_once(PIWIK_INCLUDE_PATH . "/core/API/Request.php" );
//Piwik Analytics
Piwik_FrontController::getInstance()->init();
//query request
$request = new Piwik_API_Request('
method=Actions.getPageUrl
&pageUrl=/releases.php?id=123456
&idSite=1
&date=today
&period=month
&format=php
&token_auth=xxxxxxxxxxxxxxxxxxxx
');
// Calls the API and fetch data back
$pageStats = $request->process();
Any help would be appreciated and thanks for reading.
fl3x7