Created
December 16, 2016 09:53
-
-
Save egoist/b099837ebfe30bede285d39c0a08e36b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import routerga from 'vue-router-ga' | |
const router = new Router() | |
routerga(router, 'UA-XXXXX-Y') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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