Matomo plugin for Gatsby

Plugin for Gatsby to add tracking with the open-source analytics platform Matomo (formerly Piwik) onto a site, prioritizing user experience & privacy with sensible defaults.

Features

  • include tracking code in all server-side rendered routes
  • track all route views as custom events
  • load tracking scripts at end of body tag
  • use image tracking fallback for <noscript>
  • don’t load anything when visitor has Do Not Track enabled
  • don’t load anything in non-production environments
  • consent mode for privacy
  • allow loading tracking script locally
  • define paths to be excluded from tracking
  • dev mode for local development

Usage

First, install the plugin from your project’s root:

cd yourproject/
npm i gatsby-plugin-matomo

Then load the plugin from your gatsby-config.js and set the required variables:

plugins: [
  {
    resolve: 'gatsby-plugin-matomo',
    options: {
      siteId: 'YOUR_SITE_ID',
      matomoUrl: 'https://YOUR_MATOMO_URL.COM',
      siteUrl: 'https://YOUR_LIVE_SITE_URL.COM'
    }
  }
]

Check out & contribute

Head over to GitHub for more documentation, take a peek into the code, or to report some bugs.

GitHub

Changelog

0.6.0 (2018-12-05)

0.5.1 (2018-11-21)

0.5.0 (2018-08-06)

0.4.1 (2018-06-28)

  • improvements for SPA tracking (7d653d5)
  • package updates (347f951)
  • Release 0.4.1 (b254c13)
  • chore(package): update eslint to version 5.0.0 (bd2c161)

0.4.0 (2018-06-19)

0.3.2 (2018-05-23)

0.3.1 (2018-05-14)

0.3.0 (2018-05-10)

  • allow local piwik.js path to be set (a15146c)
  • Release 0.3.0 (2e36f13)

0.2.0 (2018-05-08)

0.1.3 (2018-05-08)

0.1.2 (2018-05-08)

  • do nothing on route updates when piwik isn't loaded and in development (6c0a840)
  • move greenskeeper badge (b361eef)
  • Release 0.1.2 (370025f)

0.1.1 (2018-05-07)

0.1.0 (2018-05-07)

  • add Travis, add badges, add semi-auto releases (fe823b7)
  • initial commit 🍹 (49bffd3)
  • Release 0.1.0 (09739a7)

sourced from kremalicious/gatsby-plugin-matomo:CHANGELOG.md