I have a Nuxt.js web client which I'd like to track with Google Analytics.
I'm using the vue-gtag like so:
/plugins/vue-gtag.js
import Vue from 'vue'
import VueGtag from 'vue-gtag'
export default ({ app }) => {
Vue.use(
VueGtag,
{
config: { id: process.env.GTAG }, // this is defined in my Netlify env variables together with my backend API which works
appName: 'SleepRescue',
bootstrap: true,
enabled: true,
pageTrackerScreenviewEnabled: true,
},
app.router
)
}
nuxt.config.js
plugins: [
...
{ src: '~/plugins/vue-gtag' },
...
]
I'm also defining custom events like so:
async registerUser() {
this.$gtag.event('sign_up', {
event_category: 'engagement',
event_label: 'method',
})
...
}
Feel free to have a look at the plugin, my Nuxt config and the given example of a custom tag.
Unfortunately, my Google Analytics dashboard does not recognise any traffic not does it seem to recognise any of the tags that I've defined. I've tried accessing my website from multiple machines and IPs but there is still no traffic. If I go into my GA account -> Admin -> Data Streams, I can see my website under "Web" but it says "No data received in the last 48 hours". If I click into it, then I'll be able to see the G-****** ID as Measurement ID, I thought that as long as it matches what I have in my VueGtag ID, it should work.
Does anyone know what could be wrong here?