TracPiwik is a Trac plugin that will enable your Trac environment to be logged by Piwik. It is mostly based on the excellent TracGoogleAnalytics.
To enable the plugin add this to the [components] section in your trac.ini:
tracpiwik.* = enabled
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
In this example, the Site ID is 1.
* Base URL: The base URL of your Piwik installation. If the URL of your Piwik installation would be http://www.example.com/piwik/, you'd enter www.example.com/piwik (without http:// and the trailing slash).
* admin_logging: Disabling this option will prevent all logged in TRAC_ADMIN's from showing up on your Piwik reports.
* authenticated_logging: Disabling this option will prevent all authenticated users from showing up on your Piwik reports.
* extensions: Enter any extensions of files you would like to be tracked as a download. For example to track all MP3s and PDFs enter mp3|pdf. Outbound link tracking must be enabled for downloads to be tracked.