diff --git a/gatsby-config.js b/gatsby-config.js index e456559..08f7ae2 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -87,14 +87,32 @@ module.exports = { }, { - resolve: `gatsby-plugin-google-analytics`, + resolve: 'gatsby-plugin-google-gtag', options: { - trackingId: process.env.TRACKING_ID, - head: true, - anonymize: true, + 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: { + // trackingId: process.env.TRACKING_ID, + // head: true, + // anonymize: true, + // }, + // }, + // XML, para rodar, gatsby build && gatsby-server `gatsby-plugin-sitemap`, // this (optional) plugin enables Progressive Web App + Offline functionality 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",