@blackwall/gtm-nuxt
v1.0.4
Published
Google Tag Manager module for Nuxt.js
Downloads
6
Readme
@bchteam/gtm-nuxt
Google Tag Manager module for Nuxt.js
Features
The module enables vue-gtm for Nuxt.js.
The module supports defining options by function with Nuxt context as argument.
Setup
- Add
@bchteam/gtm-nuxt
dependency using yarn or npm to your project - Add
@bchteam/gtm-nuxt
tomodules
section ofnuxt.config.js
- Add options in
gtm
section ofnuxt.config.js
or with module.
{
modules: [
['@blackwall/gtm-nuxt', {
id: (ctx) => ctx.app.$env.GTM_ID,
enabled: true,
}]
],
gtm: {
debug: function (ctx) {
return ctx.app.$env.GTM_DEBUG === 'true'
},
ignoredViews: ['homepage'],
},
}
Options
Options can be passed in nuxt.config.js
.
See vue-gtm for details
id
- Type:
String
- Default:
null
enabled
- Type:
Boolean
- Default:
false
debug
- Type:
Boolean
- Default:
false
ignoredViews
- Type:
Array
- Default:
[]
License
Copyright (c) 2019 Sapozhkov Evgeniy [email protected]