Manage Users
This document will cover the methods to create a user and set communication channel preferences along with push notification token
How Suprsend identifies a user
SuprSend identifies users with immutable distinct_id
. It’s best to map the same identifier in your DB with distinct_id
in SuprSend. Do not use identifiers that can be changed like email or phone number. You can view synced users by searching distinct_id
on Users page.
Identify user and Set Push token
Create/Identify a new user
You can identify a user using ssApi.identify()
method. Androidpush token is automatically set in user’s profile when this method is called.
Call this method as soon as you know the identity of user, that is after login authentication. If you don’t call this method, user will be identified using distinct_id (uuid) that sdk generates internally.
We internally create an event called $user_login
. You can see this event on SuprSend workflows event list and you can configure a workflow on it.
Parameters | Type | Description |
---|---|---|
distinct_id | int, bigint, string, UUID | mandatory Unique identifier for a user across devices or between multiple logins. |
Call reset to clear user data on log out
As soon as the user logs out, call ssApi.reset()
method to clear data attributed to a user. This will generate a new random distinct_id
and clear all super properties. This allows you to handle multiple users on a single device.
When you call this method, we internally create an event called $user_logout. You can see this event on SuprSend workflows event list and you can configure a workflow on it.
Don’t forget to call reset on user logout. If not called, user id will not reset and multiple tokens and channels will get added to the user_id who logged in first on the device.
Set Communication Channels
You can send communication channel details of a user to the SuprSend SDK. We will store the channel details in the user profile. This will allow us to send communications to a user on the channels available for that user whenever there is any communication trigger.
Set User Properties
You can use SuprSend SDK to set advanced user properties, which will help in creating a user profile. You can use these properties to create user cohorts on SuprSend’s platform with future releases.