Socket
Socket
Sign inDemoInstall

typescript-yandex-metrica

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    typescript-yandex-metrica

Yandex Metrica async typescript Implementation


Version published
Maintainers
1
Install size
12.3 kB
Created

Readme

Source

Typescript обертка для работы с Yandex Metrika

yarn add typescript-yandex-metrica

Использование

Параметры инициализации счетчика https://yandex.ru/support/metrica/code/counter-initialize.html

Доступные методы https://yandex.ru/support/metrica/objects/method-reference.html

import { Metrika } from "typescript-yandex-metrica"

// Инициализиурем счетчик
conts metrika = new Metrica(0000000);
// Отправляем событие
counter.fireEvent('CUSTOM_JS_EVENT').then(() => {});
// ручной вызов события просмотра URL (Когда defer = true)
counter.hit('http://example.domain/index.html').then(() => {});

// Вызов не описанных в обертке методов
metrika.getCounter().then((counter) => {
  counter.notBounce()
});

// Асинхронный вариант
(async function() {
  const counter = await metrika.getCounter();
  counter.notBounce();
})()


Keywords

FAQs

Last updated on 18 May 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc