Matomo plugin for Gatsby
- 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
- 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
- dev mode for local development
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: ''siteUrl: ''
Head over to GitHub for more documentation, take a peek into the code, or to report some bugs.