Piwik Support
Piwik is a downloadable, open source (GPL licensed) real time web analytics software program. SourceForge provides support for analytics through a Piwik hosted app instance for every project.
The infix-site-skin supports addition of Piwik web analytics tracking script addition to site pages.
The Piwik script is generated on the presence of the /project/body/head/piwik element in the site.xml of the site.
Configuration
The Piwik element in site.xml of the site triggers the generation of the Piwik analytics script in every page. The element has two attributes for configuration:
Attribute | Use | Description |
---|---|---|
baseUrl | Required | The base URL part of the Piwik instance, without the protocol. It is defined as the the {$PIWIK_URL} value in Piwik documentation. |
siteId | Required | The site id of the website in the Piwik instance. It is defined as the {$IDSITE} in the Piwik documentation. |
A sample configuration for the site of this skin is shown below:
<piwik siteId="1" baseUrl="sourceforge.net/apps/piwik/mvn-infix/"/>
Generated Tracker
The skin generates the tracking script as documented at the Piwik JavaScript tracking documentation. The current script generated is:
<!-- Piwik --> <script type="text/javascript"> var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$PIWIK_URL}" : "http://{$PIWIK_URL}"); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); </script><script type="text/javascript"> try { var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$IDSITE}); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} </script> <!-- End Piwik Tag -->
The script is generated in /html/head section of every page with the variables defined in the configuration section above.
Unsupported Piwik Features
At this time the skin does not support additional Features of the Javascript Tracker. The skin only generates the basic tracking script.