Feature
- Add
routeChanged
event for$nuxt
, you can use it like this in your plugins:
if (process.BROWSER_BUILD) {
// set google-analytics script here...
// and then:
window.onNuxtReady((app) => {
app.$nuxt.$on('routeChanged', (to, from) => {
ga('set', 'page', to.fullPath)
ga('send', 'pageview')
})
})
}