Piwik tags
Piwik is a great analytics program that competes with Google Analytics. It’s got great statistics and graphs and is being actively developed. There are hooks for plugins, and an API for getting output statistics.
However, it doesn’t have a working <noscript></noscript> for when javascript is disabled. This PHP script creates it. Merely put it in your piwik directory and include it. Then run piwik_tag(‘Your page title’); or if you have more than one website, piwik_tag(‘Your page title’,2); where 2 is your website’s ID in piwik.
Ideally this would be integrated right into piwik, but the problem is getting the proper page title programmatically. This is key to tracking, and is done automatically by javascript. I suppose someone could code output buffering and grab the page title that way, but there’s a performance penalty.
Note that you can simplify the code to just use a tracking image. This will avoid javascript altogether. However, this means losing piwik’s ability to:
- Track downloads
- Track outgoing links
- Track time on page
- (and probably a few other nifty statistics)