Socket
Book a DemoInstallSign in
Socket

@atxmtx/metrics

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atxmtx/metrics

Sends events to Google Analytics from within Atom

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
12
200%
Maintainers
1
Weekly downloads
 
Created
Source

@atxmtx/metrics

npm npm CircleCI David

Sends events to Google Analytics from within Atom

Installation

npm install @atxmtx/metrics -S

Usage

Examples:

// JavaScript
import Metrics from '@atxmtx/metrics';

export async function activate() {
    const ga = new Metrics('UA-XXXX-Y');

    ga.event({
      category: 'Demo',
      action: 'Package activated!'
    });
};
# CoffeeScript
const Metrics = require "@atxmtx/metrics"

module.exports =
  activate: () ->
    ga = new Metrics("UA-XXXX-Y");

    ga.event {
      category: "Demo"
      action: "Package activated!"
    }

Methods

constructor

Usage: new Metrics(trackingID: string, options: object)

Instantiates class and adds event listeners, unless option.muted is used

listen

Usage: listen()

Manuall add event listener, e.g. for when option.muted is true

mute

Usage: mute()

Removes event listener

event

Usage: event({ category: string, action: string, label?: string, value?: number})

Sends an event to Google Analystics

Options

cacheBuster

Type: boolean
Default: false

Used to send a random number in GET requests to ensure browsers and proxies don't cache hits.

muted

Type: boolean
Default: false

Skips add event listeners when the class is instantiated.

License

This work is dual-licensed under The MIT License and the GNU General Public License, version 2.0

Keywords

atom

FAQs

Package last updated on 21 Feb 2020

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