User

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 null or 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.email and user.name act as an alias. They are added to user.properties under name and email keys.

User properties

User properties can be edited using a properties singleton:

Smartlook.Instance.user.properties;

📘

Properties API

Full documentation of how to put, get and remove properties 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 session

Opening 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 shareability

The URL is only available when the SDK is able to communicate with the Smartlook backend. Otherwise, it is null.

The URL is 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 listeners

Multiple User.Listener can be registered and work in parallel.