Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lingobus/vue-gtagjs

Google gtag.js for Vue.js
https://github.com/lingobus/vue-gtagjs

google-analytics google-gtag googleanalytics gtags vue vuejs

Last synced: 3 days ago
JSON representation

Google gtag.js for Vue.js

Awesome Lists containing this project

README

        

# vue-gtagjs

Google gtag.js for Vue.js

Install
====
> yarn add vue-gtagjs

Usage
====

## with vue router
```js
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
```js
import gtagjs from 'vue-gtagjs'
gtagjs(set => set(location.pathname), GA_TRACKING_ID, {debug: true, scriptId: 'customId'})
```