mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
docs: update vue-gtag
plugin example (#18528)
This commit is contained in:
parent
ec977c5877
commit
95f45b3fc5
@ -148,7 +148,7 @@ yarn add --dev vue-gtag-next
|
||||
Then create a plugin file `plugins/vue-gtag.client.js`.
|
||||
|
||||
```ts
|
||||
import VueGtag from 'vue-gtag-next'
|
||||
import VueGtag, { trackRouter } from 'vue-gtag-next'
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.vueApp.use(VueGtag, {
|
||||
@ -156,6 +156,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
id: 'GA_MEASUREMENT_ID'
|
||||
}
|
||||
})
|
||||
trackRouter(useRouter())
|
||||
})
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user