Open s00d opened 1 year ago
adding lazy loading, after add you can use custom gtm plugin, example to change the tag after loading the module
// pugins/gtm.ts import {defineNuxtPlugin, useRouter} from 'nuxt/app' import { createGtm, type VueGtmUseOptions } from '@gtm-support/vue-gtm' export default defineNuxtPlugin((nuxt) => { if (process.client) { const options = nuxt.$config.public.gtm const router = useRouter() const pluginOptions: VueGtmUseOptions = { ...options, vueRouter: options.enableRouterSync && router ? router as VueGtmUseOptions['vueRouter'] : undefined, id: 'GTM-YYYYYY' } nuxt.vueApp.use(createGtm(pluginOptions)) } })
adding lazy loading, after add you can use custom gtm plugin, example to change the tag after loading the module