Integrate Yandex.Metrika into your VuePress app with a few configuration lines 🔧
From your VuePress project directory run
yarn add --dev --exact vuepress-plugin-metrika
Add the following lines to the .vuepress/config.js
:
module.exports = {
plugins: [
...
[
'metrika',
{
counter: 'XXXXXXX',
config: {...},
},
],
]
}
where XXXXXXX
is your Metrika counter, and config
is an optional parameter
with the following defaults:
{
accurateTrackBounce: true,
clickmap: true,
trackLinks: true,
webvisor: false
}
See more about Yandex.Metrika configuration options.
And you're good to go! 🚀 Build your VuePress site as usual and enjoy your analytics 📈