This plugin enables support for Piwik in your Rails application. Configuring this plugin is easy:
PiwikAnalytics::Config.id_site = <Site ID> PiwikAnalytics::Config.url = <Piwik-URL>
Where the <Site ID> the ID of your website inside Piwik. You can look it up under Settings -> Websites. <Piwik-URL> must be replaced by the URL to your Piwik installation.
If you want PiwikAnalytics to use the asynchronous tracking code which was introduced in Piwik 1.1 you can add the folliwing line:
PiwikAnalytics::Config.use_async = true
If you want to enable the tracking code for particular controllers simply add the following line to those controllers:
after_filter :add_piwik_analytics_tracking
If you’d like to add the tracking code to every controller then add the after_filter to your application controller.
Enjoy :)
Copyright© 2010-2011 Fabian Becker, released under MIT licence.