nuxt-ym
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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

Local development
# Install dependencies
pnpm install

# Generate type stubs
pnpm run dev:prepare

# Develop with the playground
pnpm run dev

# Build the playground
pnpm run dev:build

# Run ESLint
pnpm run lint

# Run Vitest
pnpm run test
pnpm run test:watch

# Release new version
pnpm run release

Package Sidebar

Install

npm i nuxt-ym

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

11.2 kB

Total Files

20

Last publish

Collaborators

  • nick-risinger