Check out example codes for "gridsome google tag manager". It will help you in understanding the concepts better.

Code Example 1

module.exports = {
  plugins: [
    {
      use: 'gridsome-plugin-gtm',
      options: {
        id: 'GTM-XXXXXXX',
        enabled: true,
        debug: true
      }
    }
  ]
}

Learn ReactJs, React Native from akashmittal.com