Giter VIP home page Giter VIP logo

yandex-metrika-module's Introduction

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

yandex-metrika-module's People

Contributors

antmorozov avatar archiedeveloper avatar arkhamvm avatar ilyasemenov avatar naumstory avatar osben avatar pi0 avatar pickrelated avatar stbaer avatar x-range avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.