@nuxtjs/google-gtag
Advanced tools
Comparing version 0.0.4 to 1.0.2
@@ -5,2 +5,36 @@ # Change Log | ||
<a name="1.0.2"></a> | ||
## [1.0.2](https://github.com/https://github.com/nuxt-community/google-gtag/compare/v1.0.1...v1.0.2) (2018-05-17) | ||
<a name="1.0.1"></a> | ||
## [1.0.1](https://github.com/https://github.com/nuxt-community/google-gtag/compare/v0.0.5...v1.0.1) (2018-05-17) | ||
<a name="0.0.5"></a> | ||
## [0.0.5](https://github.com/https://github.com/nuxt-community/google-gtag/compare/v0.0.4...v0.0.5) (2018-05-17) | ||
Removed dependency of `vue-gtag` | ||
Bugfix: | ||
* this.$gtag() works not correctly in components | ||
Improved: | ||
* new options `disableAutoPageTrack` | ||
* Debug improved to track all `$gtag()` calls and prints out the arguments | ||
* added test for event tracking | ||
Breaking Change: | ||
* `options` renamed to `config` | ||
```js | ||
// nuxt.config.js | ||
'google-gtag':{ | ||
id:'ID_XX_XX', | ||
config: { | ||
// your gtag options | ||
} | ||
} | ||
``` | ||
<a name="0.0.4"></a> | ||
@@ -7,0 +41,0 @@ ## [0.0.4](https://github.com/https://github.com/nuxt-community/google-gtag/compare/v0.0.3...v0.0.4) (2018-05-11) |
@@ -7,12 +7,24 @@ const {resolve} = require('path') | ||
if (options && options.id) { | ||
if (!isProd && !options.options.debug) { | ||
if (!isProd && !options.debug) { | ||
return // disable if not debug mode | ||
} | ||
this.options.head.script.push({ | ||
src: `https://www.googletagmanager.com/gtag/js?id=${options.id}`, | ||
async: true | ||
}) | ||
this.addPlugin({ | ||
src: resolve(__dirname, './templates/plugin.js'), | ||
fileName: 'google-gtag.js', | ||
src: resolve(__dirname, './templates/config.js'), | ||
fileName: 'google-gtag-config.js', | ||
options: Object.assign({}, options), | ||
ssr: false | ||
}) | ||
if (!options.disableAutoPageTrack) { | ||
this.addPlugin({ | ||
src: resolve(__dirname, './templates/plugin.js'), | ||
fileName: 'google-gtag-plugin.js', | ||
options: Object.assign({}, options), | ||
ssr: false | ||
}) | ||
} | ||
} | ||
} |
@@ -1,5 +0,5 @@ | ||
import gtagjs from 'vue-gtagjs' | ||
export default async function ({app: {router}}) { | ||
gtagjs(router, '<%= options.id %>', <%= JSON.stringify(options.options, null, 2) %>) | ||
export default async function ({meta,app, app: {router}}) { | ||
router.afterEach(function (to) { | ||
app.$gtag('config', '<%= options.id %>', {'page_path': to.fullPath}) | ||
}) | ||
} |
{ | ||
"name": "@nuxtjs/google-gtag", | ||
"version": "0.0.4", | ||
"version": "1.0.2", | ||
"description": "Google GTag for Nuxt.js", | ||
@@ -32,5 +32,3 @@ "license": "MIT", | ||
}, | ||
"dependencies": { | ||
"vue-gtagjs": "^1.0.7" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -37,0 +35,0 @@ "nuxt": "latest", |
@@ -30,16 +30,9 @@ # @nuxtjs/google-gtag | ||
// With options | ||
['@nuxtjs/google-gtag', { /* module options */ }], | ||
['@nuxtjs/google-gtag', { /* module options */ }], | ||
] | ||
// alternative also as | ||
'google-gtag':{ | ||
// your options | ||
} | ||
// example config | ||
'google-gtag':{ | ||
id: 'UA-XXXX-XX', // required | ||
options:{ | ||
config:{ | ||
// this are the config options for `gtag | ||
@@ -53,3 +46,4 @@ // check out official docs: https://developers.google.com/analytics/devguides/collection/gtagjs/ | ||
}, | ||
debug: true // enable to track in dev mode | ||
debug: true, // enable to track in dev mode | ||
disableAutoPageTrack: false // disable if you don't want to track each page route with router.afterEach(...) | ||
} | ||
@@ -56,0 +50,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8130
0
7
45
1
74
- Removedvue-gtagjs@^1.0.7
- Removedvue-gtagjs@1.0.7(transitive)