vue-handy-ga

1.2.1 • Public • Published

VueHandyGa

Vue.js plugin making Google Analytics (RGPD friendly) integration easy!

Quick start

1. Install

Install the npm package using CLI

npm install vue-handy-ga
# or
yarn add vue-handy-ga

2. Usage

Vue.js

In your index.js file :

import Vue from 'vue'
import Vuex from 'vuex'
import VueHandyGa from 'vue-handy-ga'

import App from './App.vue'

Vue.use(Vuex)
Vue.use(VueHandyGa)

const options = {
  gaID: 'UA-XXXXXXXX-X'
}

new Vue({
  el: '#app',
  store: new Vuex.Store(),
  vueHandyGaSettings: new VueHandyGa(options),
  render: createElement => createElement(App)
})

In your Single File Component :

<template>
  <div>
    <vue-handy-ga />
  </div>
</template>

<script>
export default {}
</script>

Nuxt.js

In your nuxt.config.js file :

export default : {
  // [...]
  modules: [
    ['vue-handy-ga/nuxt', {
      gaID: 'UA-XXXXXXXX-X'
    }]
  ]
  // [...]
}

Then you can use it the same way you would in a Vue Single File Component.

Documentation

Find the official documentation here

License

MIT

Credits

Readme

Keywords

Package Sidebar

Install

npm i vue-handy-ga

Weekly Downloads

6

Version

1.2.1

License

MIT

Unpacked Size

62 kB

Total Files

12

Last publish

Collaborators

  • pedraal