0.1.2 • Published 6 months ago

nuxt-ym v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Nuxt Yandex Metrika module

Nuxt Yandex Metrika

npm version npm downloads License Nuxt

A lightweight module for integrating Yandex.Metrika into Nuxt, enabling easy analytics setup and tracking user interactions

Features

  •  Simple setup
  • 🚠  Automatic tag connection
  • 🌲  Support for multiple counters

Quick Setup

  1. Install the module to your Nuxt application with one command:
# Using nuxi
npx nuxi module add nuxt-ym

# Using pnpm
pnpm add -D nuxt-ym

# Using yarn
yarn add --dev nuxt-ym

# Using npm
npm install --save-dev nuxt-ym
  1. Add nuxt-yandex-metrika to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-yandex-metrika'],
});

That's it! You can now use My Module in your Nuxt app ✨

Configure

export default defineNuxtConfig({
  modules: ['nuxt-yandex-metrika'],
  yandexMetrika: {
    counters: [
      {
        id: <CointerId>,
        accurateTrackBounce?: false,
        childIframe?: false,
        clickmap?: false,
        defer?: false,
        ecommerce?: false,
        params?: {},
        userParams?: {},
        trackHash?: false,
        trackLinks?: false,
        trustedDomains?: [],
        type?: 0,
        webvisor?: false,
        triggerEvent?: false,
        sendTitle?: false,
      }
    ],
    debug: process.env.NODE_ENV !== 'production',
  }
});

Contribution