@nuxtjs/yandex-metrika

[![npm](https://img.shields.io/npm/dt/@nuxtjs/yandex-metrika.svg?style=flat-square)](https://www.npmjs.com/package/@nuxtjs/yandex-metrika) [![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/yandex-metrika/latest.svg?style=flat-square)](https:/

Usage no npm install needed!

<script type="module">
  import nuxtjsYandexMetrika from 'https://cdn.skypack.dev/@nuxtjs/yandex-metrika';
</script>

README

Yandex Metrika

npm npm (scoped with tag)

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 @nuxtjs/yandex-metrika dependency using yarn or npm to your project
  • Add @nuxtjs/yandex-metrika to modules section of nuxt.config.js
{
  modules: ['@nuxtjs/yandex-metrika'],
}

Configure

You can pass options directly in module declaration.

{
  modules: [
    [
      '@nuxtjs/yandex-metrika',
      {
        id: 'XXXXXX',
        webvisor: true,
        // clickmap:true,
        // useCDN:false,
        // trackLinks:true,
        // accurateTrackBounce:true,
      }
    ],
  ]
}

Or you can specify yandexMetrika key.

{
  modules: ['@nuxtjs/yandex-metrika'],
  yandexMetrika: {
    id: 'XXXXXX',
    webvisor: true,
    // clickmap:true,
    // useCDN:false,
    // trackLinks:true,
    // accurateTrackBounce:true,
  },
}

Options

For more information:

id

  • Required

accurateTrackBounce

childIframe

clickmap

defer

ecommerce

params

userParams

trackHash

trackLinks

trustedDomains

type

useCDN

ut

webvisor

triggerEvent