Track Users

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.

Track User Attributes

Use Growlytics.user.push to add/update session customer attributes. For example, when customer selects city for checking out furniture, you can update city attribute of the customer even though they haven't logged in.

index.js
Growlytics.user.push( {
  city: 'San Francisco'
});

User Login & Logout

Ensure log in and log out of users are implemented correctly during the visit to your website and users are authenticated.

Login User

Use Growlytics.user.identify method to associate user with Growlytics.

Growlytics.user.identify('THE_USER_ID_IN_YOUR_APP', {
  // Reserved customer properties (Used in campaigns)
  name: 'John Wick',
  email: 'john@gmail.com',
  mobile: '9876543210',

  // Custom properties
  subscriptionType: 'pro',
  region: 'Mumbai',
  totalPurchaseTillNow: 30000
});

name, email, and 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.

Log Out

Use this function to forcefully log out the current user.

Growlytics.user.logout();

Make sure you do logout() before you use Growlytics.identify(), or else previously identified user's data may get updated.

Last updated