Replies: 1 comment 1 reply
-
This is working here: import VueGtag from 'vue-gtag'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueGtag, {
config: {
id: 'G-xxx'
}
}, useRouter())
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I installed vue-gtag version 2.0.1, and created a file
plugins/ga.client.js
, is this the correct code? I tried getting the $gtag object by usingconst {$gtag} = useNuxtApp()
, but that returns undefined.Beta Was this translation helpful? Give feedback.
All reactions