User Identifier & Properties
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.
<?php
require 'vendor/autoload.php';
$client = \Hackle\HackleClients::create("YOUR_SDK_KEY");
$user = \Hackle\Common\HackleUser::builder()
->deviceId("ae2182e0")
->build();
$event = \Hackle\Common\HackleEvent::builder("purchase")
->property("pay_method", "CARD")
->property("discount_amount", 800)
->property("is_discount", true)
->build();
//테스트 그룹 분배
$variation = $client->variation(42 , $user);
//사용자 이벤트 전송
$client->track($event, $user);
?>Additional Identifiers
Property
The Hackle SDK supports adding properties to User (HackleUser) 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 128.
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