Client-Side Tracking

In addition to server-side tracking, Userlist also allows client-side tracking — via the same tracking script that powers in-app messages. See this article on how to include a JavaScript snippet in your application's layout for signed-in users.

The same tracking script allows you to update the user's properties and to track custom events in the client's browser.

Please ensure that these calls are made after the included tracking script, either by placing these calls below the script tags in your HTML or by using the page load event to delay execution.

Sending Users

The tracking script exposes a global userlist function that receives a method name and a list of arguments. To update user properties, please use the identify method, followed by a object of properties. Please see the integration guide for a list of available properties.

userlist('identify', {
  email: '',
  properties: {
    first_name: 'Foo',
    last_name: 'Example'

Sending Events

In order to track custom events, use the track method name and pass the event name as a second argument. Optionally, you can pass additional properties of the event as a third argument.

// Track a custom event
userlist('track', 'project_created');

// Track a custom event with event properties
userlist('track', 'project_created', { name: 'Example project' });

Still need help? Contact Us Contact Us