Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

Piwik Tracking code installation

Summary

How is installed the tracking code throughout the web application.

Web applications

BugGenie

  • File core/templates/footer.inc.php has the Piwik tracking code
  • Visitor exclusion: None

MediaWiki

Status (tumblr)

  • Login to Tumblr, in Settings, WebPlatform.org site, Search for Theme, click 'customize’, find ‘Edit HTML’ button, added code.
  • Visitor exclusion: None

WordPress

Static pages

Customizations

MediaWiki

// In file Piwik.hooks.php, within AddPiwik method

    $wgPiwikCustomJS[] = <<<'JS'

          // Note from renoirb: Should be moved somewhere else soon
          jQuery(document).ready(function(){
              jQuery('body').on('click', '#ca-edit', function(){
                 if (typeof _paq !== 'undefined') {
                    _paq.push(['trackGoal',1]);// Goal specific to edit a page
                 }
              });
          });

JS;

    // Do NOT fail the attempt if it failed, please.
    try {
      if ( $wgUser->isAnon() === false ) {
        $userName = $wgUser->getName();
        $wgPiwikCustomJS[] = '          _paq.push(["setCustomVariable",1,"username","'.$userName.'", "visit"]);'.PHP_EOL;
      }
    } catch(Exception $e) {  }