Smartlook records user interaction sessions. Every session has a single user and a single user can have multiple sessions. For more information on users, see Life cycle, session, and user.
User identifier
To specify the user identifier:
Smartlook.Instance.user.Identifier = "sample-identifier";
Identifier restrictions
- Identifier cannot be
nullor empty- Maximum length is IDENTIFIER_MAX_LENGTH.
User name and email
You can set the name and email properties directly:
Smartlook.Instance.user.Name = "John Doe";
Smartlook.Instance.user.Email = "[email protected]";Both
user.emailanduser.nameact as an alias. They are added touser.propertiesundernameand
User properties
User properties can be edited using a properties singleton:
Smartlook.Instance.user.properties;
Properties APIFull documentation of how to
put,getandremoveproperties can be found in the properties section.
Open a new user
The current user can be closed and a new user opened:
Smartlook.Instance.user.OpenNew();
New user sessionOpening a new user opens a new session. For more information, see Life cycle, session, and user.
User URL
The URL of the currently recorded user can be obtained:
String? userUrl = Smartlook.Instance.user.Url;
Nullability and shareabilityThe
URLis only available when the SDK is able to communicate with the Smartlook backend. Otherwise, it isnull.The
URLis not publicly sharable. You must log in to the dashboard.
User Listeners
A listener can be registered to listen to the visitor URL changes:
Smartlook.user.OnUserURLChanged((uri) => {
// TODO listen for changes
});
Multiple listenersMultiple
User.Listenercan be registered and work in parallel.
