Skip to main content
Gainsight Inc.

Track your Users and Accounts

ATTENTION: Documentation Updates are in Process
We are in the process of updating the screenshots, GIFs, and content to match the latest UX based on the Horizon Experience’s new look and feel. To learn more about the Horizon Experience in Gainsight PX, click here.

If you have already completed the initial setup steps outlined in our guides here, then your web application is now sending real-time events (i.e. page view, sessions, clicks) to Gainsight PX along with their respective user and account information.

Here's a quick setup video:

This article gets into some more detail around the second part, specifically, how those users and accounts are tracked or sent to your Gainsight PX subscription.

The Identify Call

The Gainsight PX javascript SDK exposes an identify() call that your developers have added to the authentication/login area of your web application.  The identify call is made during the authorization / login area of your web application and has two parameters as per this pseudo code:

aptrinsic('identify', [userObject],[accountObject]);

Note that the useObject parameter is required but the accountObject parameter is optional (i.e. when the user's account information is not available).

// required
aptrinsic('identify', {id: 'user-id'});
// optional
aptrinsic('identify', {id: 'user-id'},{id:'account-id'});

Identify your Users (Post Successful Login)

Here is a sample identify call that is passing some user and account info to your Gainsight PX subscription.

// Minimum Required
aptrinsic('identify', {id: 'user-id'});
// optional to include the account object 
aptrinsic('identify', {id: 'user-id'},{id:'account-id'});

The value for the user and account id's must be unique across your Gainsight PX subscription.  Typical examples of an id can be a Unique Identifier coming from your database, a GUID, or the user's email address.

Default Attributes

Your Gainsight PX subscription comes loaded with a default set of user and account attributes, the User and Account Model help doc lists the current set of default attributes and their detail. You can also check navigate to Account Settings -> Attributes to see the list of all default and custom attributes.

Custom Attributes

If you have user or account attributes that are not part of the default set, you can add them as custom attributes by navigating to Account Settings -> Attributes and clicking on the New Button:


In case you are using Date type field - you must pass it as UTC time in milliseconds

Take notice of the Attribute’s API name as this will be the name to use in your identify() call.  Remember that the attribute name should match exactly what is defined as the Attribute Name in the Account Settings -> Attributes page. 

// it is recommended to include the user and account along with custom attributes
   'id': 'unique-user-id',             // Required for logged in app users
   'email': '',
   'signupDate': 1516234662215,//UTC in milliseconds
   'firstName': 'John',
   'lastName': 'Smith',
   "userHash": '', // optional transient for HMAC identification
   // flat custom attributes
    "plan" : "gold",
    "price" : 95.5
   'id':'IBM',                         //Required
   'name':'International Business Machine',
   // flat custom attributes
   'Program': 'Platinum'

One final but important note, when sending JSON values, be sure that

  • String types are enclosed in quotes
  • Number types are NOT enclosed in quotes
  • Date types are sent as a Long Value using Epoch time in milliseconds, like here.
  • Was this article helpful?