Google Analytics Plugin for Vue

Install & Download:

# Yarn
$ yarn add vue-analytics
# NPM
$ npm install vue-analytics --save

Description:

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:

vue-analytics

Add Comment