From f91ff83fa95d7bd6ea4c9ae0cf2bca33d29cb097 Mon Sep 17 00:00:00 2001 From: Mingdong Luo Date: Tue, 3 Mar 2020 12:55:54 +0800 Subject: [PATCH] feat(plugin): add google-analytics --- gatsby-config.js | 7 +++++++ package-lock.json | 18 ++++++++++++++++++ package.json | 1 + 3 files changed, 26 insertions(+) diff --git a/gatsby-config.js b/gatsby-config.js index 8daa88e..36505e8 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -64,6 +64,13 @@ module.exports = { icon: `src/assets/images/favicon.svg`, }, }, + { + resolve: `gatsby-plugin-google-analytics`, + options: { + // replace this with your own Tracking ID + trackingId: `UA-108097003-4`, + }, + }, `gatsby-plugin-react-helmet`, { resolve: `gatsby-source-filesystem`, diff --git a/package-lock.json b/package-lock.json index f5dd663..24be3ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12215,6 +12215,24 @@ } } }, + "gatsby-plugin-google-analytics": { + "version": "2.1.36", + "resolved": "https://registry.npmjs.org/gatsby-plugin-google-analytics/-/gatsby-plugin-google-analytics-2.1.36.tgz", + "integrity": "sha512-yFp75vJpTvfgqZXYlel4n7G5INykAnRFCrf/n9pn/XdnL7Vx49LzLkjwZ8SJzWIU856mAyxK1MsEJH/JXkOWAg==", + "requires": { + "@babel/runtime": "^7.7.6" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz", + "integrity": "sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + } + } + }, "gatsby-plugin-manifest": { "version": "2.2.41", "resolved": "https://registry.npmjs.org/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.2.41.tgz", diff --git a/package.json b/package.json index 17542d2..ae85378 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "disqus-react": "^1.0.7", "gatsby": "^2.19.17", "gatsby-image": "^2.2.41", + "gatsby-plugin-google-analytics": "^2.1.36", "gatsby-plugin-manifest": "^2.2.41", "gatsby-plugin-mdx": "^1.0.73", "gatsby-plugin-offline": "^3.0.34",