src/index.js
function setupPageTracking(options, Vue) {

  const router = options.router

  const baseName = options.baseName || '(Vue App)'

  router.beforeEach( (route, from, next) => {
    const name = baseName + ' / ' + route.name;
    Vue.appInsights.startTrackPage(name)
    next()
  })

  router.afterEach( route => {
    const name = baseName + ' / ' + route.name;
    const url = location.protocol + '//' + location.host + '/' + route.fullPath;
    Vue.appInsights.stopTrackPage(name, url);
  })
}
function setupPageTracking(options, Vue) {

  const router = options.router

  const baseName = options.baseName || '(Vue App)'

  router.beforeEach( (route, from, next) => {
    const name = baseName + ' / ' + route.name;
    Vue.appInsights.startTrackPage(name)
    next()
  })

  router.afterEach( route => {
    const name = baseName + ' / ' + route.name;
    const url = location.protocol + '//' + location.host + '/' + route.fullPath;
    Vue.appInsights.stopTrackPage(name, url);
  })
}
function setupPageTracking ( options , Vue ) { const router = options . router const baseName = options . baseName || '(Vue App)' router . beforeEach ( ( route , from , next ) => { const name = baseName + ' / ' + route . name ; Vue . appInsights . startTrackPage ( name ) next ( ) } ) router . afterEach ( route => { const name = baseName + ' / ' + route . name ; const url = location . protocol + '//' + location . host + '/' + route . fullPath ; Vue . appInsights . stopTrackPage ( name , url ) ; } ) }
Track route changes as page views with AppInsights
@param options
Track route changes as page views with AppInsights