@gtarr/nuxtjs-yandex-metrika
v1.1.0
Published
Update version with async, preload and Vue.$metrika
Downloads
29
Readme
Yandex Metrika
Update
This version is update for @nuxtjs/yandex-metrika and @naumstory/nuxtjs-yandex-metrika modules.
Added functionality for use $metrika global.
Example for push goals in component:
this.$metrika.reachGoal('demo')
Or also in middleware:
export default function({ route, $metrika }) {
if(process.client && route.path === '/demo/') {
$metrika.reachGoal('demo')
}
}
Add Yandex Metrika to your nuxt.js application.
This plugins automatically sends first page and route change events to yandex metrika.
Note: yandex metrika is not enabled in dev mode.
You can set environment variable NODE_ENV
to production
for testing in dev mode.
Setup
- Add
@gtarr/nuxtjs-yandex-metrika
dependency using yarn or npm to your project - Add
@gtarr/nuxtjs-yandex-metrika
tomodules
section ofnuxt.config.js
{
modules: [
[
'@gtarr/nuxtjs-yandex-metrika',
{
id: 'XXXXXX',
webvisor: true
// clickmap:true,
// useCDN:false,
// trackLinks:true,
// accurateTrackBounce:true,
}
]
];
}
Options
For more information:
id
- Required