Support » Plugin: WP-Piwik » Implement PHP Tracker API

  • Resolved Ronny Harbich


    Hi, braekling,

    I like your plugin – it’s nice help for Piwik. But I have a problem: I don’t want to track users by JavaScript or Image. Piwik has an alternative: Piwik Tracking API (Advanced users)

    It’s a PHP class (PiwikTracker.php) that has to be called if a page is loaded. Do you think you can add this feature to your great plugin? If you want I can do the implementation too and create a SVN patch.

    I will give a basic implementation:

    // write log to piwik
    $t = new PiwikTracker(SITE_ID));
    // optional tracking
    $t->setUserAgent(self::validString($_SERVER['HTTP_USER_AGENT'], false));
    $t->setUrlReferrer(self::validString($_SERVER['HTTP_REFERER'], false));
    //$t->setLocalTime( '12:34:06' );
    //$t->setResolution( 1024, 768 );
    $t->setCustomVariable(2, 'httpStatus', $httpStatus);
    //$t->setPlugins($flash = true, $java = true, $director = false);
    $t->setIp(self::validString($_SERVER['REMOTE_ADDR'], false));
    // TODO: $_SERVER['SERVER_PROTOCOL'] return http only never https
    // mandatory
    $t->setUrl(self::validString('http://' . MY_DOMAIN . $_SERVER['REQUEST_URI'], false));

Viewing 1 replies (of 1 total)
  • Plugin Author braekling


    PHP API is supported since 0.9.4, currently still implemented as “BETA”. See tracking settings.

Viewing 1 replies (of 1 total)
  • The topic ‘Implement PHP Tracker API’ is closed to new replies.