-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Nuxt 2 compatibility #27
Comments
This module is made for Nuxt 3. For Nuxt 2, you can use google-analytics-module. |
Please, add "Nuxt 3" requirement somewhere on homepage. |
Sorry to hear that you ran into the trouble. Generally speaking, you can check compatibility in the Nuxt modules table. I will keep the description as-is. On December 31st, 2023, Vue 2 will reach End of Life (EOL), and Nuxt 2 will follow on June 30th, 2024. Not much time left. I already consider Nuxt 3 the “standard” and intend to keep it that way. 🙂 |
if anyone needs a library for gtag in nuxt 2, I recommend adding the script link "src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXX" in the head of nuxt.config.js and then create middleware with the code:
And create some event in middleware That way you don't need any libs. The nuxt 2 ones are outdated and don't work. |
Well that's unfortunate indeed because google-analytics-module is using Universal analytics under the hood it seems and Google is going to shut it down soon. The alternative vue-gtag listed in the thread doesn't work on SSR effectively leaving 0 libraries for Nuxt 2 users who haven't migrated yet |
Environment
Local
Reproduction
In Nuxt config:
In Vue File (Nuxt):
Describe the bug
Error when using the nuxt-gtag.
Error is - ReferenceError: useGtag is not defined
Please, how can I use the plugin successfully? I keep getting the error.
Additional context
This is a Nuxt project. With the following version numbers:
Logs
The text was updated successfully, but these errors were encountered: