1.1.0 • Published 10 years ago

simple-node-kissmetrics v1.1.0

Weekly downloads
139
License
MIT
Repository
github
Last release
10 years ago

Simple node KISSmetrics library

Build Status Code Climate Test Coverage

A simple wrapper for KISSmetrics client library written in ES6.

  • Loads KISSmetrics tracking JavaScript library.
  • Exposes a convenient interface for:
    • Setting your KISSmetrics API key.
    • Setting user properties.
    • Tracking events.

Usage example

First, install the library.

npm install simple-node-kissmetrics --save

Using is as simple as importing the library and calling a couple of functions.

import kissmetrics from 'simple-node-kissmetrics';

function setupMyApp() {
    // Must be called first to set the key for the library.  This only needs to be called once to initialise the library.
    kissmetrics.setKey(YOUR_API_KEY);
}

function trackSomething() {        
    // Track an event.
    kissmetrics.trackEvent("An event", {"property": "value"});
}

function setUserProperty() {
    // Track some user properties.
    kissmetrics.setUserProperties({"email": "user@xyz.com"});
}

You can also import specific functions if you prefer.

import { setup as setupAnalytics, trackEvent } from 'simple-node-kissmetrics';

function setupMyApp() {
    setupAnalytics();
}

function trackSomething() {
    trackEvent("An event", {"property": "value"});
}
1.1.0

10 years ago

1.0.0

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago