From c26bf26bd12eec91349bed5e3aa5d10f3b812681 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Thu, 3 Jan 2019 18:29:42 -0500 Subject: [PATCH] Adding Google Analytics integration --- gatsby-config.js | 10 +++++++++- package.json | 1 + yarn.lock | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index 6066c63..6b194ba 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -11,6 +11,14 @@ module.exports = { }, plugins: [ 'gatsby-plugin-react-helmet', - 'gatsby-plugin-postcss' + 'gatsby-plugin-postcss', + { + resolve: 'gatsby-plugin-google-analytics', + options: { + trackingId: process.env.GA_PROPERTY, + anonymize: true, + respectDNT: true + } + } ] }; diff --git a/package.json b/package.json index e945256..dffb3c4 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "eslint": "^5.11.1", "eslint-plugin-react": "^7.12.1", "gatsby": "^2.0.81", + "gatsby-plugin-google-analytics": "^2.0.8", "gatsby-plugin-postcss": "^2.0.2", "gatsby-plugin-react-helmet": "^3.0.5", "postcss-cssnext": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index 0748b7f..386f7bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4681,6 +4681,13 @@ gatsby-link@^2.0.7: "@types/reach__router" "^1.0.0" prop-types "^15.6.1" +gatsby-plugin-google-analytics@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/gatsby-plugin-google-analytics/-/gatsby-plugin-google-analytics-2.0.8.tgz#bef7913726e70f03533c4d14bfc73f8bd73550e0" + integrity sha512-1NYqBWTpwCYhJ03x2UJ9/hgzP75Fij6dNMb/Ib+S2md5sVX0FncJrq6vwQoXXNRymH7vqbQoB9hPdaX62UHyfw== + dependencies: + "@babel/runtime" "^7.0.0" + gatsby-plugin-page-creator@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-2.0.5.tgz#16b268142aa3515b5856bf802d8eec5a6320dc1c"