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

Nuxt 3 GA4 timeline? #135

Closed
safejace opened this issue Jul 20, 2022 · 11 comments
Closed

Nuxt 3 GA4 timeline? #135

safejace opened this issue Jul 20, 2022 · 11 comments

Comments

@safejace
Copy link

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

@ermish
Copy link

ermish commented Jul 21, 2022

^ this library is failing in my nuxt 3 upgrade :(

@silverbackdan
Copy link

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.

@silverbackdan
Copy link

silverbackdan commented Jul 24, 2022

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.

@ineshbose
Copy link

I think the solution above is a brilliant place to get started if a PR could be opened with the same. I hope it doesn't take long because the main files seem to be plugin.js and module.js if I'm not wrong!

@silverbackdan
Copy link

Problem is that on first SSR load it doesn't track the right page title.

@notflip
Copy link

notflip commented Dec 23, 2022

@silverbackdan Can I trust your code snippet to work? Did you have time to test this more? Thanks!

@dapug
Copy link

dapug commented Jan 26, 2023

@silverbackdan Can I trust your code snippet to work? Did you have time to test this more? Thanks!

Didn't work for me.

@silverbackdan
Copy link

It worked at the time of posting however perhaps things have changed, sorry for this.

@johannschopplich
Copy link

Hey guys! I've created a seamless GA4 integration for Nuxt 3. 👉 github.com/johannschopplich/nuxt-gtag

Features

@rutgerbakker95
Copy link

@johannschopplich awesome. I will try

@harlan-zw
Copy link
Contributor

Will track here #140 :)

@harlan-zw harlan-zw closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2023
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

9 participants