Skip to content
Gatsby plugin for Simple Analytics
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src
.babelrc
.gitignore
.npmignore
.prettierrc
README.md
index.js
package-lock.json
package.json

README.md

Simple Analytics Gatsby Plugin

Privacy friendly analytics without cookies and needed consent.

Install with npm install gatsby-plugin-simple-analytics.

What does it do

It tracks page views with support for pushState navigation. It sends the data to Simple Analytics and it will be available in your dashboard. You need to have a paid subscription for it to work.

How to use

  1. Add our plugin to gatsby-config.js

    plugins: [
      'gatsby-plugin-simple-analytics'
    ]
  2. If you want to set a custom domain, use this config:

    plugins: [
      {
        resolve: 'gatsby-plugin-simple-analytics',
        options: {
          // Optional custom domain
          domain: 'your.custom.domain'
        }
      }
    ]

    Read our docs on the custom domain feature.

Use with Metomic

Metomic provides a privacy-by-design API to ethically manage your users' data. It's pretty cool.

If you want to use it with Metomic's data-micropolicy use this config:

plugins: [
  {
    resolve: 'gatsby-plugin-simple-analytics',
    options: {
      metomic: 'POLICY-SLUG'
    }
  }
]

It will result in something like this:

<script src="https://cdn.simpleanalytics.io/hello.js" async="" defer="" type="text/x-metomic" data-micropolicy="POLICY-SLUG">

Contribute

If you know how to improve this plugin, please submit a PR, we are usually fast with merging it.

You can’t perform that action at this time.