I am trying to setup Google Analytics tracking for a Nuxt.js application but I'm not getting any data at all. I feel like I must be missing something obvious.
I have looked at https://google-analytics.nuxtjs.org/ and gone through the first setup page. Do I need to do anything more? The documentation promises that the router instance is added out of the box during installation, so it should handle page tracking automatically, but this has not been my experience.
I have added the Google Analytics module twice, as seen below, to nuxt.config.js just looking for a pulse but no such luck. I have also tried each individually. The ID I am passing in is already being used on another website, and my application builds without errors:
buildModules : [
'@nuxtjs/eslint-module',
'@nuxtjs/style-resources',
'@nuxtjs/google-analytics'
],
googleAnalytics: {
id: 'GTM-MYIDHERE',
layer: 'dataLayer',
pageTracking: true
},
modules : [
['nuxt-modernizr',
{
'feature-detects' : ['touchevents', 'img/webp'],
options : ['setClasses']
}],
['@nuxtjs/google-analytics', {
id: 'MYIDHERE',
layer: 'dataLayer',
pageTracking: true
}]
],
Any help here would be greatly appreciated.