Skip to content

Instantly share code, notes, and snippets.

@egoist
Created December 16, 2016 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egoist/b099837ebfe30bede285d39c0a08e36b to your computer and use it in GitHub Desktop.
Save egoist/b099837ebfe30bede285d39c0a08e36b to your computer and use it in GitHub Desktop.
import routerga from 'vue-router-ga'
const router = new Router()
routerga(router, 'UA-XXXXX-Y')
export default function (router, trackID) {
router.afterEach(to => {
if (!ga) return
ga('set', 'page', to.fullPath)
ga('send', 'pageview')
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment