New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

yandex-metrika-module-nuxt3

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yandex-metrika-module-nuxt3

Add Yandex Metrika to your Nuxt 3 application.

  • 1.4.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-12.68%
Maintainers
1
Weekly downloads
 
Created
Source

Yandex Metrika for Nuxt 3

npm version npm downloads License

Disclaimer

This package is a fork for those who don't want to wait for the official release of a Yandex Metrika module.

The module was created by Nuxt Community and rewritten by dankerow to support Nuxt 3. All credit belongs to:

This package includes precompiled scripts to let people integrate Yandex Metrika into their project. There's no need to compile anything, it is ready to be used out of the box.

Route change events by default

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

Configure

You can pass options directly in module declaration:

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

Or you can specify yandexMetrika key:

{
  modules: ['yandex-metrika-module-nuxt3'],
  yandexMetrika: {
    id: 'XXXXXX',
    // ...
  }
}

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

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

Options

For more information:

NameDefault valueTypeDescription
accurateTrackBouncetrueBooleanNumber
childIframefalseBooleanWhether to record iframe contents without a tag in a child window
clickmaptrueBooleanWhether to collect data for a click map
deferfalseBooleanWhether to disable automatically sending data during tag initialization
ecommercefalseBooleanString
paramsObjectArray
userParamsObjectParameters of site users that are transmitted when initializing the tag To transmit user parameters at any other time, use the userParams method
trackHashfalseBooleanHash tracking in the browser's address bar
trackLinkstrueBooleanTrack clicks on outbound links
trustedDomainsArrayIndicates a trusted domain for recording the contents of a child iframe. Contains the domain address of the parent window
type0NumberTag type. 1 for YAN
webvisorfalseBooleanWhether to use Session Replay
triggerEventfalseBooleanWhether to check if the tag is ready

Development

  • Clone this repository
  • Install dependencies using yarn install
  • Run yarn dev:prepare to generate type stubs.
  • Use yarn dev to start playground in development mode.

License

MIT License

FAQs

Package last updated on 03 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc