User

User identifier

Pre API 2.0

Smartlook.setUserIdentifier("sample-identifier", userProperties: {})

API 2.0

Smartlook.setUserIdentifier({ identifier: "sample-identifier" });

🚧

Identifier restrictions

  • An identifier cannot be null or left empty
  • The maximum length is 120 characters.

Identifier documentation.

User name & email

Pre API 2.0

const userProperties = {
	email: "[email protected]"
  name: "John Doe"
};

Smartlook.setUserIdentifier('sample-identifier', userProperties);

API 2.0

Smartlook.setUserName({ name: "John Doe" });
Smartlook.setUserEmail({ email: "[email protected]" });

User name & email documentation.

User properties

Pre API 2.0

const userProperties = {
	email: "[email protected]"
  name: "John Doe"
};

Smartlook.setUserIdentifier('sample-identifier', userProperties);

API 2.0

Smartlook.setUserProperty({ propertyName: 'property-name', value: 'property-value' });

Smartlook.instance.user.removeUserProperty({ propertyName: 'property-name' });

const userProperty = await Smartlook.getUserProperty({ propertyName: 'property-name' });

🚧

Name restrictions

  • Cannot be empty or null.
  • The maximum length is 200 characters.
  • Can only contain alphanumeric characters, underscore (_), comma (,), period (.), and hyphen (-).
  • Must start with an alphabetic character.

🚧

Value restrictions

  • The maximum length is 5 kilobytes.

User properties documentation.