Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-plugin-google-analytics-gtag

npm

Gatsby plugin to add Google Analytics support to your site leveraging Google’s gtag.js library.

The main difference with the official Gatsby plugins is that this one doesn’t use cookies to track visitors.

Usage

plugins: [
  {
    resolve: 'gatsby-plugin-google-analytics-gtag',
    options: {
      trackingId: 'UA-YOURIDHERE-1',
      enableSessionStorage: true,
      consentMode: 'granted'
    }
  },
]
Option Description Values
constentMode Allows to specify the default consent options denied or granted
© 2023 Gatsby, Inc.