npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

altumanalytics-node

v1.0.0

Published

event tracking

Downloads

5

Readme

AltumAnalytics.js

AltumAnalytics.js is designed to collect customer data and send it to machine learning service for future processing.

We prefer to associate our library with a smart advisor called Altum.

Altum helps you measure your users, product, and business. It calculates statistic for your business and generate advises about your customers, provide charts and different integrations.

Documentation

Installation

Install from NPM

npm install --save altumanalytics

or if you want to specify version:

npm install --save altumanalytics@version      (i.e. npm install --save [email protected])

Include the library via script or manually and initialize it

Ideally you would use module loader or compilation step to import using ES6 modules as:

import { Altum } from 'altumanalytics';

Altum.init({productId: 'PRODUCT ID', groupId: 'GROUP_ID', userId: 'USER ID'});

If you prefer CommonJS modules then the library can be included as

const Altum = require('altumanalytics').Altum;

Altum.init({productId: 'PRODUCT ID', groupId: 'GROUP_ID', userId: 'USER ID'});

Initialization

Altum is exported as the Singleton, so you don't need to create a new instance.

Call Altum.init to initialize library.

  Altum.init(configurationObject);

configurationObject contains next properties:

| Property Name | Type | Required | Description |-------------------|-----------------|--------------|--------------| | productId | String | Required | Your unique product Id. Exception will be thrown if not provided.| | groupId | String | Required | Unique identifier per license.| | userId | String | Required | Current signed in userId. (Usually Db Key).|

Note: Altum.init method can be called several times to change current product or current user.

Examples:

Init library after user sign in and specify the product:

Altum.init({productId: 'test', groupId: '123', userId: '12345'});

Usage

Altum provide only one API method which should be used in your application:

Log method definition:

Altum.log(event, count, options);

The Altum.log method is how you send any event with it's data to our processing center.

The log call has the folowing parameters:

| Parameter Name | Required | Type | Description | |-------------------|-----------------|--------------|---------------------| | event | Required | String or Object | Event Type which will be used to identificate tracked event. If object provided, it should include property type in it.| | count | Required | Float Number | Positive Number which will be associated with tracked event.Note: If you do not pass a count, pass 1 as default.| |options | Optional | Object | A dictionary of options (see details below). |

Options object may contain next properties:

| Property Name | Type | Description | |-------------------|-----------------|--------------| | data | Object | Any data associated with tracked event. | | time | TimeStamp | js representation of time (example (new Date).getTime()). If not provided, current UTC time will be used| |groups | Array | Array of groups to categorize event for future using |

Examples

Log any custom event:

Altum.log('My Amazing Event', 1)

Log javascript click event:

const eventObj = { type: 'click' };  //here will be js event object
Altum.log(eventObj, 1);

Log event with custom data object:

Altum.log(eventObj, 1, { data: { customProperty: 'customValue' }});

Log event with several groups:

Altum.log('Grouped event', 1, { groups: ['First', 'Second']});

Log historical event:

const historicalTime = (new Date('01-03-2015')).getTime();
Altum.log('Grouped event', 1, { time: historicalTime });

Log user payment event:

Altum.log('Payment', 100.34, { data: { objectId: 'egwg1251f' }, groups: ['Payments'] })