All Projects → kolkov → ngx-metrika

kolkov / ngx-metrika

Licence: MIT license
Angular Yandex Metrika (Модуль поддержки счетчиков Яндекс Метрика для Angular 6+)

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to ngx-metrika

yii2-stat
Yii2 Multi Web Statistic Module (yametrika, google-analytic, own db-counter)
Stars: ✭ 18 (+38.46%)
Mutual labels:  yandex-metrika
gtm-guidelines
A collection of best practices for your daily Google Tag Manager routine
Stars: ✭ 39 (+200%)
Mutual labels:  tracking
socitrack
A wearable platform for social interaction studies
Stars: ✭ 16 (+23.08%)
Mutual labels:  tracking
exploring-my-neighborhood
track all your moves and visualize them!
Stars: ✭ 16 (+23.08%)
Mutual labels:  tracking
hart-pytorch
Reimplementation of Hierarchical Attentive Recurrent Tracking (Kosiorek et al., 2017) in PyTorch
Stars: ✭ 17 (+30.77%)
Mutual labels:  tracking
webb-tracker-api
James Webb Space Telescope (JWST) tracking REST API
Stars: ✭ 67 (+415.38%)
Mutual labels:  tracking
usps-api
Python Wrapper for the USPS API 🚚 📦
Stars: ✭ 52 (+300%)
Mutual labels:  tracking
COVID-19-tracker
北航大数据高精尖中心研究团队进行数据来源的整理与获取,利用自然语言处理等技术从已公开全国4626确诊患者轨迹中抽取了基本信息(性别、年龄、常住地、工作、武汉/湖北接触史等)、轨迹(时间、地点、交通工具、事件)及病患关系形成结构化信息
Stars: ✭ 75 (+476.92%)
Mutual labels:  tracking
ridesharing-ios
Ridesharing driver & rider sample apps using HyperTrack SDK
Stars: ✭ 97 (+646.15%)
Mutual labels:  tracking
Mobile Phone Tracking
This repository is source code for some of the attacks defined in this paper (https://arxiv.org/pdf/1703.02874v1.pdf). Not all attacks will be available. Please read the README.md
Stars: ✭ 20 (+53.85%)
Mutual labels:  tracking
MMM-ShipmentTracking
Shipment Tracking Module for MagicMirror²
Stars: ✭ 24 (+84.62%)
Mutual labels:  tracking
soulcare
🔥 A centralised health care system that tracks each dose given to the patient by the nurse. Also let's specialist doctors respond to the patient immediately via logs generated.
Stars: ✭ 23 (+76.92%)
Mutual labels:  tracking
CrowdFlow
Optical Flow Dataset and Benchmark for Visual Crowd Analysis
Stars: ✭ 87 (+569.23%)
Mutual labels:  tracking
TrajectoryTracking
Trajectory Tracking Project
Stars: ✭ 16 (+23.08%)
Mutual labels:  tracking
delibee
📦 Delivery tracking library on Node.js
Stars: ✭ 24 (+84.62%)
Mutual labels:  tracking
MTF
Modular Tracking Framework
Stars: ✭ 99 (+661.54%)
Mutual labels:  tracking
yolo deepsort
Fast MOT base on yolo+deepsort, support yolo3 and yolo4
Stars: ✭ 47 (+261.54%)
Mutual labels:  tracking
smashblock
📡 🛡️A self-updating extensive blocklist filter for AdGaurd. Be sure to 🌟 this repository for updates!
Stars: ✭ 66 (+407.69%)
Mutual labels:  tracking
2019Fall FA
2019秋季学期泛函分析笔记QAQ🦄
Stars: ✭ 43 (+230.77%)
Mutual labels:  hit
m2.TrackingLink
Magento2. Extension add Tracking Url in Shipment Email.
Stars: ✭ 35 (+169.23%)
Mutual labels:  tracking

Angular Yandex Metrika

npm version Build Status Coverage Status codecov

A simple Yandex Mertika (Яндекс Метрика) tag.js package for Angular 6+.

Demo

Demo is here demo

Working code for this demo at stackblitz example

Install

Install via npm package manager

npm install @kolkov/ngx-metrika --save

Add the package to your app.module.ts. Then simple add property yaCounterId to the environment constant or use inline

import { RouterModule } from '@angular/router';
import { NgxMetrikaModule } from '@kolkov/ngx-metrika';

@NgModule({
  imports: [
    RouterModule.forRoot([]),
    NgxMetrikaModule.forRoot({
      id: environment.yaCounterId,
      ...      
      defer: true,
      webvisor: true,
      clickmap: true,
      trackLinks: true,
      accurateTrackBounce: true,
    })
  ]
})

Pageviews

The package will listen to route changes by default, you just need to instantiate service in the root of the project.

export class AppComponent {
  constructor(private ym: NgxMetrikaService) { }
}

NgxMetrika is a service that also allows you to track pageviews manually.

this.ym.hit.emit();

// or with custom params

this.ym.hit.emit({url: '/custom',{
  title: 'Lesson Feed',  
  referer: 'https://angularfirebase.com/lessons'
}});

ReachGoal

ReachGoal expect an action.

this.ym.reachGoal.next({target: 'TARGET_NAME'})

You can optionally pass in addtional params.

function goalCallback () {
        console.log('request to Metrika sent successfully');
    }
const options: CommonOptions = {     
         params: {
            productId: product.id,
            productName: product.name,
         },
         callback: goalCallback,
      }
this.ym.reachGoal.next({target: 'ADD_TO_CART', options});

Goal Directive

Many analytics events are tracked based on user interaction, such as button clicks. Just tell it which DOM event to track.

<button ymGoal trackOn="click" target="TRACKED">Track Me</button>

This will register a general Target in Yandex Metrika based on the target name.

You can pass optional params to the directive like so:

<div ymGoal     
     target="PROGUCT_DRAGGED"     
     [params]="{ targetLabel: 'Something cool just happened' }">

   Some Product...
   
</div>

The directive will produce the following event on dragstart.

What's included

Within the download you'll find the following directories and files. You'll see something like this:

metrika/
└── projects/
    ├── ngx-metrika/
    └── ngx-metrika-app/

ngx-metrika/ - library

ngx-metrika-app/ - demo application

Documentation

The documentation for the ngx-metrika is hosted at our website ngx-metrika

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org.

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, ngx-metrika is maintained under the Semantic Versioning guidelines.

See the Releases section of our project for changelogs for each release version.

Creators

Andrey Kolkov

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].