Closed julianfox closed 3 years ago
Use vm in nuxt
this._vm.$gtag
vue-gtag is not available in the vuex context, you should import it like this
import { set } from 'vue-gtag'
set({ userId: 'foo' })
check all methods here https://matteo-gabriele.gitbook.io/vue-gtag/api
Use vm in nuxt
this._vm.$gtag
undefined inside a nuxt 2 plugin
Description
In Nuxt this.$gtag is undefined in actions of vuex store
Expected behavior
Be able to access gtag in actions of vuex store
Actual behavior
$gtag is undefined, work well in components
Environment
Run this command in the project folder and fill in their results:
npm ls vue-gtag
: vue-gtag@1.11.0Then, specify:
Reproducible Demo