gtm loaded twice
I'm experience an error where where the gtm container is added to the dom twice. Once from the ssr and once in the client. This is happening when I use a runtime gtm id:
export default {
modules: [
'@nuxtjs/gtm'
],
gtm: {
},
publicRuntimeConfig: {
gtm: {
id: process.env.GOOGLE_TAG_MANAGER_ID
}
},
}
the initialization check inside of https://github.com/nuxt-community/gtm-module/blob/master/lib/plugin.js#L85 only takes the id and not the runtimeId into account. We do not specify an id in the non runtime gtm settings. Is the check in plugin on propose or are you open for merge requests fixing this behaviour?
do anyone else have this problem? Am I doing something wrong?
The gtm module was updated 2 years ago and doesn't support Nuxt 3. I created a discussion on this topic in case you'd like to comment or follow.