Google Analytics
Google Analytics integration for Nuxt.js with vue-analytics
📖 Release Notes
Setup
- Add
@nuxtjs/google-analytics
dependency with yarn
or npm
into your project - Add
@nuxtjs/google-analytics
to modules
section of nuxt.config.js
: - Configure it:
{
modules: [
['@nuxtjs/google-analytics', {
id: 'UA-12301-2'
}]
]
}
Using top level options
{
modules: [
['@nuxtjs/google-analytics']
],
'google-analytics': {
id: 'UA-12301-2'
}
}
Usage
Click here for all options and features of vue-analytics
Differences between vue-analytics and the Nuxt.js implementation:
- The router instance is already added out of the box (read here if you need to disable it)
- The
id
and ua
properties have the exact same behaviour. The ua
property has been added for backwards compatibily with previous releases - You can enable module for development by setting
dev: true
option in module options
Development
- Clone this repository
- Install dependencies using
yarn install
or npm install
- Start development server using
npm run dev
License
MIT License
Copyright (c) - Matteo Gabriele m.gabriele.dev@gmail.com