Analytics ready!
In the option object of the plugin there’s a callback function available that fires when analytics.js or analytics_debug.js is loaded
always remember that the debug version is more heavy than the production one and might take more to load
import VueAnalytics from 'vue-analytics'
Vue.use(VueAnalytics, {
beforeFirstHit () {
// this is right after the tracker and before every other hit to Google Analytics
},
ready () {
// here Google Analytics is ready to track!
}
})
It is also possible to use the onAnalyticsReady
method, which returns a promise.
import VueAnalytics, { onAnalyticsReady } from 'vue-analytics'
Vue.use(VueAnalytics, { ... })
const App = new Vue({ ... })
onAnalyticsReady().then(() => {
App.$mount('#app')
})
当前内容版权归 vue-analytics 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 vue-analytics .