See Vue Google Tag Manager for other options.
npm install gridsome-plugin-gtm --save
yarn add gridsome-plugin-gtm
module.exports = {
plugins: [
{
use: 'gridsome-plugin-gtm',
options: {
id: 'GTM-XXXXXXX',
enabled: true,
debug: true
}
}
]
}