nuxt-community/google-gtag

Name: google-gtag

Owner: Nuxt Community

Description: Enable google gtagjs for NuxtJs

Created: 2018-05-11 03:45:11.0

Updated: 2018-05-17 07:22:08.0

Pushed: 2018-05-17 07:22:07.0

Homepage:

Size: 889

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

@nuxtjs/google-gtag

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Google official gtagjs for Nuxt.js

? Release Notes

Features

The module includes Google googletagmanager.com/gtag/js into your project and enables it with config you pass in as options.

Setup

dules: [
// Simple usage
'@nuxtjs/google-gtag',

// With options
['@nuxtjs/google-gtag', { /* module options */ }],    


example config
ogle-gtag':{
d: 'UA-XXXX-XX', // required
onfig:{
 // this are the config options for `gtag
 // check out official docs: https://developers.google.com/analytics/devguides/collection/gtagjs/
 anonymize_ip: true, // anonymize IP 
 send_page_view: false, // might be necessary to avoid duplicated page track on page reload
 linker:{
   domains:['domain.com','domain.org']
 }
,
ebug: true, // enable to track in dev mode
isableAutoPageTrack: false // disable if you don't want to track each page route with router.afterEach(...)


Usage

This module inlcudes Google gtag in your NuxtJs project and enables every page tracking by default. You can use gtag inside of your components/functions/methods like follow:

is.$gtag('event', 'your_event', { /* track something awesome */})
Check functionalities

Install Google Tag Assistant and see if your page is being tracked.

Development
License

MIT License

Copyright (c) Dominic Garms djgarms@gmail.com


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.