Skip to content

flatpak/middleman-matomo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matomo-Middleman

Gem Version

It's an extension for the Middleman static site generator to use Matomo tracking (previously known as Piwik).

Installation

Clone the repository git clone [email protected]:wikimatze/matomo-middleman.git ~/git/matomo-middleman. Then add the following line to your Gemfile:

gem 'matomo-middleman', path: "/home/wm/git/matomo-middleman/"

Run bundle install.

Configuration

In your config.rb you can configure the settings as follow:

activate :matomomiddleman do |p|
  p.domain = '<your-domain>'
  p.id = '<your-id>
end

Helper

This plugin will add the following helper method:

<%= matomo %>

which will expand to

<script type="text/javascript">
  var _paq = window._paq = window._paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//<your-domain>/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', "<your-id>"]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img referrerpolicy="no-referrer-when-downgrade" src="https://<your-domain>/matomo.php?idsite=<your-id>&amp;rec=1" style="border:0" alt="" /></p></noscript>

About

Tracking code for matomo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%