1.2.0 • Published 3 months ago

totango-tracker v1.2.0

Weekly downloads
139
License
MIT
Repository
github
Last release
3 months ago

totango-tracker

The totango-tracker package is a simple Node.JS package, wrapping the Totango HTTP API used to log user-activity events and/or attribute-updates on accounts.

Installation

$ npm install totango-tracker

Usage

Install the package

$ npm install totango-tracker

Create a tracker Instance

//replace XXXX with your unique Totango service id, set the relevant site and add your SDR security token
const tracker = require('totango-tracker')('SP-XXXX-01','{us}/{eu}', 'sdr-token');

Track Activity

tracker.trackActivity(accountId, userId, activity, module, function(err){
    if (err) {
        // handle the error
    }
    else {
        // Success
    }
});

// Example
tracker.trackActivity('YYYYY', 'john@anonymous.com', 'some activity', 'some module', function(err){
    ...
});

Set Account Attribute(s)

tracker.setAccountAttributes(accountId, {
    'Attribute1'    : 'value1',
    'Attribute2'    : 'value2',
    }, function(err) {
         if (err) {
            // handle the error
        }
        else {
            // Success
        }
    }
);

Set User Attribute(s)

tracker.setUserAttributes(accountId, userId, {
    'Attribute1'    : 'value1',
    'Attribute2'    : 'value2',
    }, function(err) {
         if (err) {
            // handle the error
        }
        else {
            // Success
        }
    }
);

License

https://www.totango.com/terms-of-use

1.2.0

3 months ago

1.1.3

2 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

9 years ago

1.0.0

9 years ago