gridsome google tag manager

  1. Install the @gridsome/plugin-google-analytics package by running the command npm install @gridsome/plugin-google-analytics in your terminal.

  2. Add the plugin to your gridsome.config.js file by configuring the module.exports object to include the Google Analytics plugin, specifying your tracking ID.

  3. After adding the plugin, rebuild your Gridsome project using the command gridsome build to apply the changes.

  4. Verify that the Google Tag Manager code is correctly implemented by inspecting the source code of your website and checking for the presence of the Google Tag Manager script.