From a467bffeb8fb039e42b6b722ad32284e6b8cdc92 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 27 Oct 2020 10:24:24 +0100 Subject: [PATCH] add gatsby-plugin-google-analytics --- gatsby-config.js | 18 +++++++++++++++++- package-lock.json | 9 +++++++++ package.json | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index 9bd2e2b33..c85c9e4e0 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -66,6 +66,22 @@ module.exports = { cache_busting_mode: 'none' } }, - 'gatsby-plugin-webpack-size' + 'gatsby-plugin-webpack-size', + { + resolve: 'gatsby-plugin-google-analytics', + options: { + // The property ID; the tracking code won't be generated without it + trackingId: 'UA-60614729-11', + // Defines where to place the tracking script - `true` in the head and `false` in the body + head: false, + // Setting this parameter is optional + anonymize: true, + // Setting this parameter is also optional + respectDNT: true, + // Defers execution of google analytics script after page load + defer: true, + cookieDomain: 'oceanprotocol.com' + } + } ] } diff --git a/package-lock.json b/package-lock.json index c719f4f7a..7dde84193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17920,6 +17920,15 @@ "micromatch": "^4.0.2" } }, + "gatsby-plugin-google-analytics": { + "version": "2.3.19", + "resolved": "https://registry.npmjs.org/gatsby-plugin-google-analytics/-/gatsby-plugin-google-analytics-2.3.19.tgz", + "integrity": "sha512-U8HVZU3y/LoaD2UEU5h7YNsPfdJcRF11byGtiM6xE7hYqWr2YFVaKMf6L/AiREPtgaoE+YB2XfbfDrk2wUtEUA==", + "requires": { + "@babel/runtime": "^7.11.2", + "minimatch": "3.0.4" + } + }, "gatsby-plugin-manifest": { "version": "2.4.35", "resolved": "https://registry.npmjs.org/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.4.35.tgz", diff --git a/package.json b/package.json index 245de8839..66fbc1c1e 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "formik": "^2.2.0", "gatsby": "^2.24.85", "gatsby-image": "^2.4.21", + "gatsby-plugin-google-analytics": "^2.3.19", "gatsby-plugin-manifest": "^2.4.35", "gatsby-plugin-react-helmet": "^3.3.14", "gatsby-plugin-remove-trailing-slashes": "^2.3.13",