From 00fc8ec95bbf63df3dfb053610b4d7db0d90d4a3 Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Wed, 3 Feb 2021 15:39:26 +0000 Subject: [PATCH] Follow advice in https://github.com/gatsbyjs/gatsby/issues/12967 - move first, add 'head' and 'anonymise' options --- gatsby-config.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index c6a1c3fb..2f798646 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -48,6 +48,14 @@ module.exports = { } }, plugins: [ + { + resolve: `gatsby-plugin-google-analytics`, + options: { + trackingId: process.env.GOOGLE_ANALYTICS_ID, + head: true, + anonymize: true + } + }, `gatsby-plugin-styled-jsx`, // the plugin's code is inserted directly to gatsby-node.js and gatsby-ssr.js files `gatsby-plugin-styled-jsx-postcss`, // as above { @@ -198,12 +206,6 @@ module.exports = { } }, `gatsby-plugin-offline`, - { - resolve: `gatsby-plugin-google-analytics`, - options: { - trackingId: process.env.GOOGLE_ANALYTICS_ID - } - }, { resolve: `gatsby-plugin-feed`, options: {