Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtm loaded twice #148

Open
alexan opened this issue Apr 5, 2022 · 2 comments
Open

gtm loaded twice #148

alexan opened this issue Apr 5, 2022 · 2 comments

Comments

@alexan
Copy link

alexan commented Apr 5, 2022

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?

@alexan
Copy link
Author

alexan commented Apr 27, 2022

do anyone else have this problem? Am I doing something wrong?

@iannngit
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants