0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Piwik tracker integration for Middleman
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Middleman-Piwik

middleman-piwik is an extension for the Middleman static site generator that ease the use of the Piwik web analytics platform.

Installation

Just add gem "middleman-piwik" to your existing Gemfile and run bundle install.

Configuration

activate :piwik do |p|
    p.id = 1
    p.domain = 'piwik.example.net'
    p.url = '/piwik'
end

id is the id of the site, as given by piwik. Usually, it start at 1.

domain is the domain name of the piwik server.

url is the url of the piwik installation. By default, it take the root of the website.

Helper

The extension adds 3 new helper to Middleman to add the proper javascript and img in your website

<%= insert_piwik_tracker %>

The one that should be almost always be used is insert_piwik_tracker, which will try to insert the regular javascript code and a img tag as a fallback.

The 2 others insert_piwik_tracker_js and insert_piwik_tracker_img will add only the javascript tracker or the img one.