User Identifier & Properties
Identifier
The User Identifier is used to uniquely identify a user. You can manage User Identifiers through the Hackle SDK.
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.
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