global site tag (gtag.js) - google analytics gatsby

JavaScript
Copygatsby-config.js: copy code to clipboardmodule.exports = {  plugins: [    {      resolve: `gatsby-plugin-google-analytics`,      options: {        // replace "UA-XXXXXXXXX-X" with your own Tracking ID        trackingId: "UA-XXXXXXXXX-X",      },    },  ],}Copycopy code to clipboardnpm install --save gatsby-plugin-google-analytics
Source

Also in JavaScript: