Include Piwik with PHP


Hi from France :slight_smile:

Is it possible to call Piwik in my website with PHP and not JavaScript ?

Thanks a lot.

(Thomas Seifert) #2



I’ve ever seen this link, I’va added this code

require_once $_SERVER['DOCUMENT_ROOT']."/piwik/PiwikTracker.php";
PiwikTracker::$URL = '';

$t = new PiwikTracker( $idSite = 1, '');

in my index.php page but it doesn’t work :frowning:

Can you help me ?

(Thomas Seifert) #4

Is that URL reachable from your server at all?
Is the code at the given Path (document_root/piwik/… ) ?


Oh I’ve made a mistake on my code :

I replaced the line 2 with :

PiwikTracker::$URL = '';

and deleted the line 3.

It’s working now :slight_smile:

Thank’s to you