1.4.0 • Published 2 years ago

@nuxtjs/yandex-metrika v1.4.0

Weekly downloads
1,585
License
MIT
Repository
github
Last release
2 years ago

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',
    // ...
  }
}

In Nuxt 2.13+, you can also use public runtime config:

{
  modules: ['@nuxtjs/yandex-metrika'],
  publicRuntimeConfig: {
    yandexMetrika: {
      id: process.env.YANDEX_METRIKA_ID,
      // ...
    }
  }
}

Options

For more information:

id

  • Required

useRuntimeConfig

  • Default: yandexMetrika

Public runtime config key. Set to false to disable runtime configuration.

useCDN

  • Default: false

Load metrika script from https://cdn.jsdelivr.net/npm/yandex-metrica-watch/watch.js.

This option can not be provided via runtime config.

accurateTrackBounce

childIframe

clickmap

defer

ecommerce

params

userParams

trackHash

trackLinks

trustedDomains

type

ut

webvisor

triggerEvent

1.4.0

2 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago