Segment.page()

Track whenever a user sees a page of your website or screen of your mobile app, along with any properties about the page.

Usage

Hover over inputs/exits for more info.

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


// Track whenever a user sees a page of your website or screen of your mobile app, along with any properties about the page.

Segment.page({

writeKey: 'C3ut91L4284abn2VdaJ2813Zc193042Kl4',

userId: '019mr8mf4r',

pageName: 'Signup',

pageCategory: 'Docs',

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'
pageName required

The name of the of the page, for example "Signup" or "Home".

'Signup'
pageCategory

The category of the page. Useful for things like ecommerce where many pages often live under a larger category.

'Docs'
properties

A free-form dictionary of properties of the page, like "keywords" or "referrer".

integrations

A dictionary of Segment integrations to either enable or disable.

Exits

error

An unexpected error occurred.

success

OK.