Google Analytics Plugin for Vue

This is a Vue plugin that makes it easier to use Google Analytics in your app.


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: []



Download Details:

Author: MatteoGabriele

Live Demo:

Download Link:

Official Website:

Install & Download:

# Yarn
$ yarn add vue-analytics

$ npm install vue-analytics --save

Add Comment