Closed safejace closed 1 year ago
^ this library is failing in my nuxt 3 upgrade :(
Looks like it should probably move over to using vue-gtag - this module doesn't look so complicated. If I get implemented I'll post here what I've done.
Actually, for google analytics, there is a simple plugin example for implementing it here: https://v3.nuxtjs.org/guide/directory-structure/plugins/#vue-plugins - might be a useful way to get started. E.g.
import VueGtag from "vue-gtag";
export default defineNuxtPlugin((nuxtApp) => {
const router = useRouter();
nuxtApp.vueApp.use(
VueGtag,
{
config: {
id: "GA_MEASUREMENT_ID",
},
},
router
);
});
I think this is double tracking right now though and not sure if it's detecting page changes as views properly so needs some looking into.
Problem is that on first SSR load it doesn't track the right page title.
@silverbackdan Can I trust your code snippet to work? Did you have time to test this more? Thanks!
@silverbackdan Can I trust your code snippet to work? Did you have time to test this more? Thanks!
Didn't work for me.
It worked at the time of posting however perhaps things have changed, sorry for this.
Hey guys! I've created a seamless GA4 integration for Nuxt 3. 👉 github.com/johannschopplich/nuxt-gtag
Features
gtag.js
.env
file support@johannschopplich awesome. I will try
Will track here https://github.com/nuxt-community/google-analytics-module/issues/140 :)
hey,
just wondering if there is a roadmap for the nuxt3 module and if it will support GA4. i would be willing to help with testing/dev but i just don't know where to find any work on it