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' });


By default, the connection to Userlist's servers will be closed and re-established on page load. Passing a new token for a different user will gracefully switch users.

For single page applications, it's possible to reset the current connection by calling destroy. This will close the connection to the server and allows the use of a new token.


Afterwards you can setup a new connection with a new token.

userlist('init', 'insert-generated-user-token-here');

Start now. We will help.

You don't just get a new platform — you get a team of email professionals to back you up. We'll do a free 60-min roadmapping session with you, create your custom design theme, and help you adopt our signature framework.