User Identifier & Properties

circle-info

User Identifier Management

User Identifiers are used for the purpose of uniquely identifying users. For information about the meaning and importance of User Identifiers and criteria for choosing them, refer to the Managing User Identifiers documentation.

Using Your Own User Identifier

Because server-side SDKs cannot identify users on their own, you must always pass the User Identifier directly as a parameter. The identifier you pass can be a Primary Key you manage directly, a device identifier, a member ID, an email address, a hash value, or similar.

Example

Here is an example of performing Variation Distribution and then sending a user event.

import "github.com/hackle-io/hackle-go-sdk/hackle"

user := hackle.NewUserBuilder().ID("ae2182e0").Build()

// 테스트 그룹 분배
variation := hackleClient.Variation(42, user)

// 사용자 이벤트 전송
hackleClient.Track(event, user)

Additional Identifiers

You can send additional identifiers beyond the default identifiers using the example code below.

Property

The Hackle SDK supports adding properties to User objects.

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

  • The maximum number of properties that can be added to a user object is 64.

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 Decision, and Event Tracking. In the example below, you can see that three properties (age, grade, is_paying_user) have been added.

Last updated