Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 459 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 459 Bytes

vue-gtagjs

Google gtag.js for Vue.js

Install

yarn add vue-gtagjs

Usage

with vue router

import gtagjs from 'vue-gtagjs'
import VueRouter from 'vue-router'


Vue.use(VueRouter)
const router = new VueRouter()
gtagjs(router, GA_TRACKING_ID, {debug: true, scriptId: 'gtagjs'})

Without vue router

import gtagjs from 'vue-gtagjs'
gtagjs(set => set(location.pathname), GA_TRACKING_ID, {debug: true, scriptId: 'customId'})