Segment.track()

Track a user action by triggering an event in Segment.

Usage

Hover over inputs/exits for more info.

var Segment = require('machinepack-segment');


// Track a user action by triggering an event in Segment.

Segment.track({

writeKey: 'C3ut91L4284abn2VdaJ2813Zc193042Kl4',

userId: '019mr8mf4r',

event: 'foobarbaz',

properties: {},

integrations: {},

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

writeKey required

The "write key" associated with your Segment account.

'C3ut91L4284abn2VdaJ2813Zc193042Kl4'
userId required

A unique identifier for the user who performed this action.

'019mr8mf4r'
event required

The name of the action this user performed.

'foobarbaz'
properties

A free-form dictionary of properties of the event, like "quantity".

integrations

A dictionary of Segment integrations to either enable or disable.

Exits

error

An unexpected error occurred.

success

OK.