Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix(page): track previous page
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGabriele committed Jan 6, 2020
1 parent cc858f7 commit 125462f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function trackRoute (route) {
}

export function autoTracking () {
const { router, autoTracking } = config
const { router, autoTracking, $vue } = config

if (!autoTracking.page || !router) {
return
Expand All @@ -105,7 +105,10 @@ export function autoTracking () {
return
}

trackRoute(router.currentRoute)
// see https://github.com/nuxt-community/analytics-module/issues/8
$vue.nextTick().then(() => {
trackRoute(router.currentRoute)
})
})
})
}

0 comments on commit 125462f

Please sign in to comment.