1.1.0 • Published 7 years ago

sandbox-insights v1.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

sandbox-insights

This is the public node package repository for the Insights project

Installation

Install the package with:

npm install sandbox-insights --save

Usage

The package needs to be initialized with your app's App Key which you can find on your SandBox Insights App Management page. Require it with the key's value:

var SBInsights = require('sandbox-insights')('...your app key...');

On ES6, this would look like:

import sbInsightsPackage from 'sandbox-insights';
const SBInsights = sbInsightsPackage('...your app key...');

Recording Events

To track events, use the module like this:

SBInsights.recordEvent('eventCategory', 'actionName');

Recording Page Views

To track page views, use the module like this:

SBInsights.recordPageView('pageName');

Recording Users and User Data

// to record the start of a user session, call this function and pass along a unique identifier for the user
SBInsights.recordUser('identifier');

// to record and update the user's data, call this function once you've started the user's session
SBInsights.updateUser('identifier', 'data type', 'value');

// the currently supported data types are:
//   'email'
//   'locale'
//   'firstName'
//   'lastName'
//   'platform'
//   'versionNumber'

More functionality coming soon

1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago