Gatsby Google Analytics
by John Vincent
Posted on September 20, 2019
Configuring Google Analytics with Gatsby is straightforward.
Gatsby Google Analytics Plugin
Using the plugin gatsby-plugin-google-analytics
, add to gatsby-config.js
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: `UA-102737102-1`,
head: false,
exclude: [`/private/**`],
cookieDomain: `${domain}`,
},
},
where domain
= johnvincent.io
This plugin is only executed for production builds.
Gatsby
- Gatsby and Client Only Components
- Gatsby Getting Started
- Gatsby Google Analytics
- Gatsby Google Maps
- Gatsby Helmet
- Gatsby Manifest
- Gatsby Markdown
- Gatsby Overview of johnvincent.io
- Gatsby React Icons
- Gatsby Robots file
- Gatsby RSS Feed
- Gatsby Sass
- Gatsby Sitemap
- Gatsby Webpack Bundle Analyzer
- Migration of johnvincent.io to Next.js from Gatsby
- Overview of port to Next.js from Gatsby