Yandex Metrika integration for Nuxt 3
npm install @artmizu/yandex-metrika-nuxt- Support Nuxt 4 and Nuxt 3, nuxt 2 users can use this one
- Prints handy mesages in a dev mode, when certain goals is reached
- Expose useful methods to the nuxt app instance
- Fully customizable via runtime config
- Types for external API
Install package via a package manager:
``bashusing npm
npm install @artmizu/yandex-metrika-nuxt
Add it to a modules section of your nuxt config:
`js
export default {
modules: ['@artmizu/yandex-metrika-nuxt'],
}
`Options
You can pass it through runtime config, module options and the special nuxt
config property
yandexMetrika.$3
- Type:
string
- Required
- Description: Yandex metrika IDOther parameters you can see in the type file here
Runtime Config
Alternatively, leveraging automatically replaced public runtime config values by matching environment variables at runtime, set your desired option in your project's
.env file:`bash
Sets the
yandexMetrika.id module option
NUXT_PUBLIC_YANDEX_METRIKA_ID=12345678
``