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

User Identifier & Properties

Identifier

For the meaning and importance of User Identifiers and guidelines for choosing one, refer to the Managing User Identifiers document.

The User Identifier is used to uniquely identify a user. You can manage User Identifiers through the Hackle SDK.

Category
Description

The client manages User Identifiers internally. The client uses two main types of identifiers. - The Device ID provided by the Hackle SDK - Custom identifiers

The server does not manage User Identifiers internally. A User Identifier must always be passed for every server request.

Property

The Hackle SDK supports adding properties to the User object. By sending user-specific information as User Properties, you can reduce repetitive coding while making rich use of them in A/B Tests and data analytics.

  • Properties must be sent as key-value pairs (Property Key and Property Value).

  • A maximum of 128 properties can be added.

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.

Example

The User object is used as a parameter in variation distribution, Feature Flag decisions, and event tracking. The example below shows three properties (age, grade, is_paying_user) being added.

import io.hackle.android.HackleApp
import io.hackle.sdk.common.User
import io.hackle.sdk.common.Variation

User user = User.builder()
  	.userId(userId)
    .property("age", 30)
    .property("grade", "GOLD")
    .property("is_paying_user", false)
    .build();

// Variation distribution
Variation variation = hackleApp.variation(experimentKey, user);

// Feature Flag decision
boolean featureOn = hackleApp.isFeatureOn(featureKey, user);

// Event tracking
hackleApp.track(event, user);

Last updated