From 3a3b3fb36923c84136f34c298972ca97cec51ab2 Mon Sep 17 00:00:00 2001 From: Junior Alves Date: Fri, 24 Mar 2023 19:34:53 -0300 Subject: [PATCH 1/2] chore: add new gtag 4 --- gatsby-config.js | 18 ++++++++++++++++++ package.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index e456559..565317c 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -86,6 +86,24 @@ module.exports = { }, }, + { + resolve: 'gatsby-plugin-google-gtag', + options: { + trackingIds: [ + process.env.GA_MEASUREMENT_ID, // GA Measurement + ], + gtagConfig: { + optimize_id: 'OPT_CONTAINER_ID', + anonymize_ip: true, + cookie_expires: 0, + }, + pluginConfig: { + head: true, + respectDNT: true, + }, + }, + }, + { resolve: `gatsby-plugin-google-analytics`, options: { diff --git a/package.json b/package.json index d08be1e..ba38d4e 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "gatsby-image": "^2.2.8", "gatsby-plugin-algolia-search": "0.5.0", "gatsby-plugin-feed": "^2.5.11", - "gatsby-plugin-google-analytics": "^2.3.13", + "gatsby-plugin-google-gtag": "^5.8.0", "gatsby-plugin-manifest": "^2.3.6", "gatsby-plugin-netlify-cms": "^4.1.9", "gatsby-plugin-offline": "^3.1.4", From d83cce02ea14ca58fb70e64f19edf226bfcbdafa Mon Sep 17 00:00:00 2001 From: Junior Alves Date: Fri, 24 Mar 2023 19:48:54 -0300 Subject: [PATCH 2/2] chore: add new gtag 4 --- gatsby-config.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 565317c..08f7ae2 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -104,14 +104,14 @@ module.exports = { }, }, - { - resolve: `gatsby-plugin-google-analytics`, - options: { - trackingId: process.env.TRACKING_ID, - head: true, - anonymize: true, - }, - }, + // { + // resolve: `gatsby-plugin-google-analytics`, + // options: { + // trackingId: process.env.TRACKING_ID, + // head: true, + // anonymize: true, + // }, + // }, // XML, para rodar, gatsby build && gatsby-server `gatsby-plugin-sitemap`,