# User Identifier & Properties

{% hint style="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](/en/getting-started/user-identifier.md) documentation.
{% endhint %}

### 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
<?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

```php
<?php
require 'vendor/autoload.php';

$user = \Hackle\Common\HackleUser::builder()
    ->userId("123")
    ->deviceId("ae2182e0")
    ->identifier("myCustomId","customId")
    ->build();
?>
```

## 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 64.

<table><thead><tr><th width="133.04296875">Category</th><th width="127.60546875">Type</th><th>Constraints</th></tr></thead><tbody><tr><td>Property Key</td><td><code>string</code></td><td><ul><li>Character limit is 128 characters.</li><li>Case-insensitive.</li><li>For example, AGE and age are recognized as the same Property Key.</li></ul></td></tr><tr><td>Property Value</td><td><code>boolean</code>, <code>string</code>, <code>number</code>, <code>array</code></td><td><ul><li>For string type, the character limit is 1024 characters.</li><li>String type is case-sensitive.</li><li>For example, APPLE and apple are recognized as different Property Values.</li><li>For number type, up to 15 integer digits and up to 6 decimal places are supported.</li></ul></td></tr></tbody></table>

### 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.

```php
<?php

require 'vendor/autoload.php';

$client = \Hackle\HackleClients::create("YOUR_SDK_KEY");

$user = \Hackle\Common\HackleUser::builder()
    ->deviceId("ae2182e0")
    ->property("age", 30)
    ->property("grade", "GOLD")
    ->property("is_paying_user", false)
    ->build();

//테스트 그룹 분배
$variation = $client->variation(42 , $user);

//기능 플래그 결정
$isFeatureOn = $client->isFeatureOn(42, $user);

//사용자 이벤트 전송
$client->track($event, $user);

?>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/development-guide/php/php-user-info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
