Install & Download:
# Yarn
$ yarn add vue-analytics
# NPM
$ npm install vue-analytics --saveDescription:
This is a Vue plugin that makes it easier to use Google Analytics in your app.
Usage:
import Vue from 'vue'
import VueAnalytics from 'vue-analytics'
Vue.use(VueAnalytics, {
id: ['UA-XXX-A', 'UA-XXX-B']
})Configuration options.
id: null,
router: null,
fields: {},
ignoreRoutes: [],
linkers: [],
commands: {},
set: [],
require: [],
ecommerce: {
enabled: false,
options: null,
enhanced: false
},
autoTracking: {
shouldRouterUpdate: null,
skipSamePath: false,
exception: false,
page: true,
transformQueryString: true,
pageviewOnLoad: true,
pageviewTemplate: null,
untracked: true,
prependBase: true
},
debug: {
enabled: false,
trace: false,
sendHitTask: true
},
checkDuplicatedScript: false,
disableScriptLoader: false,
beforeFirstHit: noop,
ready: noop,
untracked: []Preview: