For the complete documentation index, see llms.txt. This page is also available as Markdown.

User Identifier & Properties

User Identifier Management

User Identifiers are used to uniquely identify users. For the meaning and importance of User Identifiers and guidelines on how to choose them, refer to the Managing User Identifiers documentation.

User Identifier

Using Identifiers Managed by the SDK

The Unity SDK includes functionality to manage device identifiers. Therefore, users can be automatically identified even without providing a User Identifier separately.

You can retrieve the identifiers managed by the SDK as follows.

Hackle hackle = Hackle.GetInstance();
// Get the device identifier managed internally
string deviceId = hackle.GetDeviceId();

Add User Identifier

You can set the identifier for a logged-in user. If you manage the device identifier yourself, you can set it separately.

Example

Hackle hackle = Hackle.GetInstance();

// 1. Add logged-in user identifier
hackle.SetUserId("LOGIN_ID");

// 2. Change device identifier
hackle.SetDeviceId("CUSTOM_DEVICE_ID");

Additional Identifiers

Additional identifiers beyond the default identifiers can be sent using the example code below.


User Property

The Hackle SDK supports adding User Properties.

  • A property must be sent as a key-value pair consisting of a Property Key and a Property Value.

  • You can add a maximum of 64 properties per user object.

Category
Type
Constraints

Property Key

string

  • Character limit is 128 characters.

  • Case-insensitive.

  • For example, AGE and age are recognized as the same Property Key.

Property Value

boolean, string, number, array

  • For string type, the character limit is 1024 characters.

  • String type is case-sensitive.

  • For example, APPLE and apple are recognized as different Property Values.

  • For number type, up to 15 integer digits and up to 6 decimal places are supported.

Configure User Properties

You can add or remove User Properties.

Instantiate a PropertyOperations object with the User Properties you want to configure. Then call UpdateUserProperties to update the User Properties. You can configure multiple properties at once.

Set

Sets a User Property. Overwrites the existing value with the configured value.

SetOnce

Sets a User Property value only once. If a property already exists for the property key, setOnce is ignored. For example, you can use this to set a user's registration date or initial registration location.

Unset

Removes a configured User Property.

ClearAll

Removes all User Properties.

Reset User Properties

You need to reset previously configured information. When reset, all previously configured identifiers and properties are cleared.

Calling ResetUser() clears all previously configured identifiers and properties.

Last updated