Identify Customers

In order to correlate sessions and errors with customer, or to see a list of customers with all session details, it is helpful to capture and display customer information on your Growlytics dashboard.

Associate Session with customer

Use Growlytics.user.identify to associate session with any registered customer. This will allow you to do analytics, monitor sessions and engage with customers by specific customer attributes like by name, email, System Id or any custom attribute your are providing with session data.

// This is an example script - don't forget to change it!
Growlytics.user.identify('THE_USER_ID_IN_YOUR_APP', {
// Reserved customer properties (Used in campaigns)
name: 'John Wick',
mobile: '9876543210',
// Custom properties
subscriptionType: 'pro',
region: 'Mumbai',
totalPurchaseTillNow: 30000
});

name, email, mobile are reserved keywords in the Growlytics platform. Growlytics will use these keywords to send emails, SMSes and more.

Customer id must be a string,(max 40 characters). Also, just like event tracking, Growlytics supports Number, BigInt, String, Boolean and Date data types for user attribute values. For further details refer to event tracking considerations.

Handling multiple sessions of the same customer

To associate each session with the customer, you can use Growlytics.identify method for each session, but make sure you are providing all same information. If at any session you provide different value for same input, previous value will be overwritten.

For example lets say you are identifying a session with following snippet

// This is an example script - don't forget to change it!
Growlytics.user.identify('LKSERCKLJRES', {
name: 'John Wick',
// Add your own custom customer variables here, ie:
subscriptionType: 'basic',
region: 'Mumbai',
totalPurchaseTillNow: 30000
});

And lets say after two days, you are identfying the session with same user LKSERCKLJRES, but this time you are providing different customer variables.

// This is an example script - don't forget to change it!
Growlytics.user.identify('LKSERCKLJRES', {
name: 'John Wick',
mobile: '9876543210',
// Add your own custom customer variables here, ie:
subscriptionType: 'pro',
region: 'Mumbai',
totalPurchaseTillNow: 63000
});

Here for new session, two values differ subscriptionType and totalPurchaseTillNow. Hence in Growlytics will keep attribute values pro and 63000 since they will overwrite previous values.