# User profile

## User ID

This method is used to initialize the user in applications where you have set calculation by user ID specified by the developer.

You can also use this method when calculating by device ID (by default) to pass in the user ID used on your servers so that you can easily find the user on devtodev.

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of th&#x65;**`DTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`setUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`setUserId`** method.

```swift
DTDAnalytics.setUserId(userId: "Custom User ID")
```

To get the current value of the user ID, use the asynchronous method \
`getDeviceId(_ completionHandler: @escaping (String) -> Void)`

```swift
DTDAnalytics.getUserId { userId in
  // your code
}
```

{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of th&#x65;**`DTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`setUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`setUserId`** method.

```objectivec
[DTDAnalytics userId:@"Custom User ID"];
```

To get the current value of the user ID, use the asynchronous method \
`(void)deviceIdHandler:( void (^ _Nonnull)(NSString * _Nonnull))completion-Handler;`

```objectivec
[DTDAnalytics userIdHandler:^(NSString * _Nonnull userId) {
  // your code
}];
```

{% endtab %}

{% tab title="Android (Kotlin)" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of th&#x65;**`DTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`setUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`setUserId`** method.&#x20;

```kotlin
DTDAnalytics.setUserId(userId = "Custom User ID")
```

To get the current value of the user ID, use the asynchronous method \
`getDeviceId(block: (String) -> Unit)`

```kotlin
DTDAnalytics.getUserId { userId ->
  // your code
}
```

{% endtab %}

{% tab title="Android (Java)" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of th&#x65;**`DTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`setUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`setUserId`** method.&#x20;

```java
DTDAnalytics.INSTANCE.setUserId("Custom User ID");
```

To get the current value of the user ID, use the asynchronous method \
`getDeviceId(block: (String) -> Unit)`

```java
DTDAnalytics.INSTANCE.getUserId(userID ->
      // your code
      null
);
```

{% endtab %}

{% tab title=".NET Native + UWP" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of th&#x65;**`DTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`SetUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`SetUserId`** method.&#x20;

```csharp
DTDAnalytics.SetUserId(userId: "Custom User ID")
```

To get the current value of the user ID, use the asynchronous method:

```csharp
var userId = await DTDAnalytics.GetUserId();
```

{% endtab %}

{% tab title="Unity" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of th&#x65;**`DTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`SetUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`SetUserId`** method.&#x20;

```csharp
DTDAnalytics.SetUserId(userId: "Custom User ID")
```

To get the current value of the user ID, use the asynchronous method:

```csharp
DTDAnalytics.GetUserId(id =>
{
  //your code
});
```

{% endtab %}

{% tab title="Web" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property in config object).

Do not pass an empty string ("") to the **`setUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`setUserId`** method.

```javascript
analytics.setUserId("Custom User ID")
```

To get the current value of the user ID, use the **`getUserId`**&#x6D;ethod&#x20;

```javascript
const userId = analytics.getUserId()
```

{% endtab %}

{% tab title="Unreal" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (***`UserId`*** property of an instance of the **`FDTDAnalyticsConfiguration`** class).

Do not pass an empty string ("") to the **`SetUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use method:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FVIkwuUenIOd7hADoZbIP%2Fimage.png?alt=media\&token=8ccac1e0-7cd0-4898-ad34-d48b3778a6a5)

| Arguments      | Type    | Description |
| -------------- | ------- | ----------- |
| ***`userId`*** | FString | User ID.    |

```csharp
UDTDAnalyticsBPLibrary::SetUserId("Name");
```

To get the current value of the user ID, use the asynchronous method:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F5AeOpTneAIbsowHF8nte%2Fimage.png?alt=media\&token=4c53ca1c-0e0d-4aaa-b6a6-3fbcd1188da9)

| Arguments        | Type                                                                                     | Description |
| ---------------- | ---------------------------------------------------------------------------------------- | ----------- |
| ***`onResult`*** | <ul><li>FAnalyticsDynamicGetterStringDelegate</li><li>FDTDGetterStringDelegate</li></ul> | Callback    |

```csharp
auto onResult = new FDTDGetterStringDelegate();
onResult->BindLambda([](const FString& value)
{
	// Your code...
});
UDTDAnalyticsBPLibrary::GetUserId(*onResult);
```

{% endtab %}

{% tab title="Godot" %}
{% hint style="info" %}
We recommend that you pass this parameter in the initialization configuration (**`userId`** property of an instance of the **GDDTDAnalyticsConfiguration** class).

Do not pass an empty string ("") to the **`setUserID`** method as the user ID. Assigning an empty string is a command to assign a default value to the user ID (it is equal to the current device ID). In applications with calculation by user ID, this can lead to unnecessary registrations.
{% endhint %}

To set a new value as the user ID, use the **`SetUserId`** method.

```gdscript
DTDAnalytics.SetUserId("Custom User ID")
```

To get the current value of the user ID, use the asynchronous method \
`DTDAnalytics.GetUserId(`onResult: `Callable)`

```gdscript
DTDAnalytics.GetUserId(getUserIdHandler)

func getUserIdHandler(userId: String): 
  print(userId)
```

{% endtab %}
{% endtabs %}

In order to track a user on several devices, you can switch the identification method to identification by Custom User Id. This switch can be done only by devtodev – you just need to write a request to the support (use the `Contact Us` form), specifying the space name and project name. You must set the user IDs for all users before changing the identification method.

{% hint style="danger" %}
**Please note: changing the identification method is irreversible and you will not be able to switch back to the device identifiers in the future!**
{% endhint %}

## Replace

This method is used in very rare cases. It is applicable in the case when the calculation of users in the project is carried out by the user ID specified by the developer. In this case, the application can change this identifier. For example, calculation in the application is carried out by user emails and in the application, it is possible to change this email to another one. At the time of replacement, you need to call this method, specifying the user's previous email and the one with which it was replaced.

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}

```swift
DTDAnalytics.replace(fromUserId: "Old user id", toUserId: "New user id")
```

{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}

```objectivec
[DTDAnalytics replaceFromUserId:@"Old user id" toUserId:@"New user id"];
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
DTDAnalytics.replaceUserId(
    fromUserId = "Old user id", 
    toUserId = "New user id"
)
```

{% endtab %}

{% tab title="Android (Java)" %}

```java
DTDAnalytics.INSTANCE.replaceUserId("Old user id", "New user id");
```

{% endtab %}

{% tab title=".NET Native + UWP" %}

```csharp
DTDAnalytics.Replace(fromUserId: "Old user id", toUserId: "New user id");
```

{% endtab %}

{% tab title="Unity" %}

```csharp
DTDAnalytics.Replace(fromUserId: "Old user id", toUserId: "New user id");
```

{% endtab %}

{% tab title="Web" %}

```javascript
analytics.replace( "Old user id", "New user id")
```

{% endtab %}

{% tab title="Unreal" %}
![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FaQuAODgeV6lBFxhnJaC7%2Fimage.png?alt=media\&token=2840a680-90fb-4360-80e3-c5dc992267b6)

| Arguments          | Type    | Description  |
| ------------------ | ------- | ------------ |
| ***`fromUserId`*** | FString | From user ID |
| ***`toUserId`***   | FString | To user ID   |

```cpp
UDTDAnalyticsBPLibrary::ReplaceUserId("UserIdBefore", "UserIdAfter");
```

{% endtab %}

{% tab title="Godot" %}

```gdscript
DTDAnalytics.ReplaceUserId("Old user id", "New user id")
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Do not use this method to re-login as a different user! The setUserId method is used for relogging.
{% endhint %}

## Current user level

This method is used in cross-platform and data-synchronised applications.\
The method is required to update user-level data.

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}
To set the current value to the user level, use **`setCurrentLevel(currentLevel: Int)`** method:

```swift
DTDAnalytics.setCurrentLevel(value: 2)
```

We recommend that you use the **`setCurrentLevel`** method immediately after using the [**`setUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`setCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`levelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`getCurrentLevel(completionHandler: @escaping (Int) -> Void)`** method

```swift
DTDAnalytics.getCurrentLevel { level in
  // your code
}
```

{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}
To set the current value to the user level, use **`(void)currentLevel:(NSInteger)currentLevel;`** method:

```objectivec
[DTDAnalytics currentLevel:2];
```

We recommend that you use the **`setCurrentLevel`** method immediately after using the [**`setUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`setCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`levelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`(void)currentLevelHandler:( void (^ _Nonnull)(NSInteger))completionHandler;`** method

```objectivec
[DTDAnalytics currentLevelHandler:^(NSInteger level) {
  // your code
}];
```

{% endtab %}

{% tab title="Android (Kotlin)" %}
To set the current value to the user level, use method:

```kotlin
DTDAnalytics.setCurrentLevel(currentLevel = 2)
```

We recommend that you use the **`setCurrentLevel`** method immediately after using the [**`setUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`setCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`levelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`getCurrentLevel(completionHandler: @escaping (Int) -> Void)`** method

```kotlin
DTDAnalytics.getCurrentLevel { level ->
  // your code
}
```

{% endtab %}

{% tab title="Android (Java)" %}
To set the current value to the user level, use method:

```swift
DTDAnalytics.INSTANCE.setCurrentLevel(2);
```

We recommend that you use the **`setCurrentLevel`** method immediately after using the [**`setUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`setCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`levelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`getCurrentLevel(completionHandler: @escaping (Int) -> Void)`** method

```java
DTDAnalytics.INSTANCE.getCurrentLevel ( currentLevel ->
       // your code 
       null
);
```

{% endtab %}

{% tab title=".NET Native + UWP" %}
To set the current value to the user level, use method:

```csharp
DTDAnalytics.SetCurrentLevel(level: 3);
```

We recommend that you use the **`SetCurrentLevel`** method immediately after using the [**`SetUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`SetCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`LevelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`GetCurrentLevel`** method:

```csharp
var currentLevel = await DTDAnalytics.GetCurrentLevel();
```

{% endtab %}

{% tab title="Unity" %}
To set the current value to the user level, use method:

```csharp
DTDAnalytics.SetCurrentLevel(level: 3);
```

We recommend that you use the **`SetCurrentLevel`** method immediately after using the [**`SetUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`SetCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`LevelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`GetCurrentLevel`** method:

```csharp
DTDAnalytics.GetCurrentLevel(level =>
{
  //your code
});
```

{% endtab %}

{% tab title="Web" %}
To set the current value to the user level, use method:

```javascript
analytics.setCurrentLevel(2)
```

We recommend that you use the **`setCurrentLevel`** method immediately after using the [**`setUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`DTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`setCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`levelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`getCurrentLevel`** method.

```javascript
const currentLevel = analytics.getCurrentLevel()
```

{% endtab %}

{% tab title="Unreal" %}
To set the current value to the user level, use method:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FeI14cDQVvwAORQjuiTrQ%2Fimage.png?alt=media\&token=3ddc307f-b79f-4f2e-a5c2-f262bcad178f)

| Arguments     | Type  | Description    |
| ------------- | ----- | -------------- |
| ***`level`*** | int32 | Current level. |

```cpp
UDTDAnalyticsBPLibrary::SetCurrentLevel(7);
```

We recommend that you use the **`SetCurrentLevel`** method immediately after using the [**`SetUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`EDTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`SetCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`LevelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use method:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2Fl3hIqsBHVdVPZrSpaCFO%2Fimage.png?alt=media\&token=ed2b7c1d-4cb2-49a8-b6aa-e9f2f9400c7e)

| Arguments        | Type                                                                               | Description |
| ---------------- | ---------------------------------------------------------------------------------- | ----------- |
| ***`onResult`*** | <ul><li>FAnalyticsDynamicGetterIntDelegate</li><li>FDTDGetterIntDelegate</li></ul> | Callback    |

```cpp
auto onResult = new FDTDGetterIntDelegate();
onResult->BindLambda([](int32 value)
{
	// Your code...
});
UDTDAnalyticsBPLibrary::GetCurrentLevel(*onResult);
```

{% endtab %}

{% tab title="Godot" %}
To set the current value to the user level, use **`SetCurrentLevel(level: int)`** method:

```gdscript
DTDAnalytics.SetCurrentLevel(2)
```

We recommend that you use the **`SetCurrentLevel`** method immediately after using the [**`SetUserID`**](#user-id) method or specify the current user level in the initialization configuration (the level property of an instance of the **`GDDTDAnalyticsConfiguration`**).

{% hint style="warning" %}
Do not use the **`SetCurrentLevel`** method when the user reaches a new level. In this case, you must use the [**`LevelUp`**](https://docs.devtodev.com/integration/integration-of-sdk-v2/basic-methods#level-up) method.
{% endhint %}

To get the user-level value stored by the SDK, use **`GetCurrentLevel(onResult: Callable)`** method

```gdscript
DTDAnalytics.GetCurrentLevel(getCurrentLevelHandler)

func getCurrentLevelHandler(level: int):
    print("result is: " + str(level))
```

{% endtab %}
{% endtabs %}

## Cheater

If you have your own methods for detecting cheaters in the application, you can tag such users. Actions taken by these users will not be counted in statistics.&#x20;

{% hint style="warning" %}
If you need to exclude transactions from such users from statistics, go to **Users & Segments** section in devtodev interface and [mark the user](https://docs.devtodev.com/reports-and-functionality/project-related-reports-and-fuctionality/users#mark-as-cheater-or-tester) manually. \
When you mark the user in devtodev interface, the system removes their transactions for the last 7 days the reports and recalculates the metrics.&#x20;
{% endhint %}

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}

```swift
DTDUserCard.setCheater(cheater: true)
```

{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}

```objectivec
[DTDUserCard setCheater:true];
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
DTDUserCard.setCheater(cheater = true)
```

{% endtab %}

{% tab title="Android (Java)" %}

```java
DTDUserCard.INSTANCE.setCheater(true);
```

{% endtab %}

{% tab title=".NET Native + UWP" %}

```csharp
DTDUserCard.SetCheater(cheater: true);
```

{% endtab %}

{% tab title="Unity" %}

```csharp
DTDUserCard.SetCheater(cheater: true);
```

{% endtab %}

{% tab title="Web" %}

```javascript
analytics.user.setCheater(true)
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FyM5EvQPy2yElFcNgrKvt%2FSetCheater.png?alt=media&#x26;token=1047e949-eb0b-4539-b73a-3887cc198fa6" alt=""><figcaption><p>Blueprint</p></figcaption></figure>

| Arguments       | Type | Description  |
| --------------- | ---- | ------------ |
| ***`cheater`*** | bool | Cheater flag |

```cpp
UDTDUserCardBPLibrary::SetCheater(true);
```

{% endtab %}

{% tab title="Godot" %}

```gdscript
DTDUserCard.SetCheater(true)
```

{% endtab %}
{% endtabs %}

## Tester

Use this method to tag a user as a tester. Events performed by testers will not be included in statistics.&#x20;

{% hint style="warning" %}
If you need to exclude transactions from such users from statistics, go to **Users & Segments** section in devtodev interface and [mark the user](https://docs.devtodev.com/reports-and-functionality/project-related-reports-and-fuctionality/users#mark-as-cheater-or-tester) manually. \
When you mark the user in devtodev interface, the system removes their transactions for the last 7 days the reports and recalculates the metrics.&#x20;
{% endhint %}

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}

```swift
DTDUserCard.setTester(tester: true)
```

{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}

<pre class="language-objectivec"><code class="lang-objectivec"><strong>[DTDUserCard setTester:true];
</strong></code></pre>

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
DTDUserCard.setTester(tester = true)
```

{% endtab %}

{% tab title="Android (Java)" %}

```java
DTDUserCard.INSTANCE.setTester(true);
```

{% endtab %}

{% tab title=".NET Native + UWP" %}

```csharp
DTDUserCard.SetTester(tester: true);
```

{% endtab %}

{% tab title="Unity" %}

```csharp
DTDUserCard.SetTester(tester: true);
```

{% endtab %}

{% tab title="Web" %}

```javascript
analytics.user.setTester(true)
```

{% endtab %}

{% tab title="Unreal" %}
![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F6s6waaQVXWxcKSNSKyNo%2FSetTester.png?alt=media\&token=d8d49396-1252-48b4-967f-d54a2bb49b84)

| Arguments      | Type | Description |
| -------------- | ---- | ----------- |
| ***`tester`*** | bool | Tester flag |

<pre class="language-cpp"><code class="lang-cpp"><strong>UDTDUserCardBPLibrary::SetTester(true);
</strong></code></pre>

{% endtab %}

{% tab title="Godot" %}

```gdscript
DTDUserCard.SetTester(true)
```

{% endtab %}
{% endtabs %}

## Reserved user properties

{% hint style="danger" %}
**Attention! These properties have been removed since the devtodev SDK versions:**\
**iOS & macOS 2.4.0, Android 2.5.0, Unity SDK 3.8.0, Godot 1.0.0, Web 2.1**

**We strongly recommend not to use these properties because they refer to** [**personal data**](https://gdpr-info.eu/issues/personal-data/)**.**&#x20;
{% endhint %}

{% tabs fullWidth="true" %}
{% tab title="iOS + macOS" %}
{% hint style="warning" %}
Attention! We strongly discourage the storage of personal user data! If you plan to pass this data, be sure to indicate this in the ‘Nutrition label’ when submitting the application to the App Store review.
{% endhint %}

| Property     | Getter                             | Setter                                                            |
| ------------ | ---------------------------------- | ----------------------------------------------------------------- |
| Name         | **`setName(name: String)`**        | **`getName(completionHandler: @escaping (String?) -> Void)`**     |
| Email        | **`setEmail(email: String)`**      | **`getEmail(completionHandler: @escaping (String?) -> Void)`**    |
| Phone        | **`setPhone(phone: String)`**      | **`getPhone(completionHandler: @escaping (String?) -> Void)`**    |
| Photo        | **`setPhoto(photo: String)`**      | **`getPhoto(completionHandler: @escaping (String?) -> Void)`**    |
| Gender       | **`setGender(gender: DTDGender)`** | **`getGender(completionHandler: @escaping (DTDGender) -> Void)`** |
| Age          | **`setAge(age: Int)`**             | **`getAge(completionHandler: @escaping (Int) -> Void`**           |
| {% endtab %} |                                    |                                                                   |

{% tab title="iOS+macOS (Objective-C)" %}
{% hint style="warning" %}
Attention! We strongly discourage the storage of personal user data! If you plan to pass this data, be sure to indicate this in the ‘Nutrition label’ when submitting the application to the App Store review.
{% endhint %}

| Property     | Setter                                              | Getter                                                          |
| ------------ | --------------------------------------------------- | --------------------------------------------------------------- |
| Age          | **`[DTDUserCard setAge:(NSInteger)];`**             | **`[DTDUserCard getAgeHandler:^(NSInteger age) { }]`**          |
| Email        | **`[DTDUserCard setEmail:(NSString * _Nonnull)];`** | **`[DTDUserCard getEmailHandler:^(NSString * email) { }];`**    |
| Gender       | **`[DTDUserCard setGender:(enum Gender)];`**        | **`[DTDUserCard getGenderHandler:^(enum Gender gender) { }];`** |
| Name         | **`[DTDUserCard setName:(NSString * _Nonnull)];`**  | **`[DTDUserCard getNameHandler:^(NSString * name) { }];`**      |
| Phone        | **`[DTDUserCard setPhone:(NSString * _Nonnull)];`** | **`[DTDUserCard getPhoneHandler:^(NSString * phone) { }];`**    |
| Photo        | **`[DTDUserCard setPhoto:(NSString * _Nonnull)];`** | **`[DTDUserCard getPhotoHandler:^(NSString * photo) { }];`**    |
| {% endtab %} |                                                     |                                                                 |

{% tab title="Android (Kotlin)" %}

| Property     | Getter                             | Setter                                        |
| ------------ | ---------------------------------- | --------------------------------------------- |
| Name         | **`setName(name: String)`**        | **`getName(handler: (String) -> Unit)`**      |
| Email        | **`setEmail(email: String)`**      | **`getEmail(handler: (String) -> Unit)`**     |
| Phone        | **`setPhone(phone: String)`**      | **`getPhone(handler: (String) -> Unit)`**     |
| Photo        | **`setPhoto(photo: String)`**      | **`getPhoto(handler: (String) -> Unit)`**     |
| Gender       | **`setGender(gender: DTDGender)`** | **`getGender(handler: (DTDGender) -> Void)`** |
| Age          | **`setAge(age: Int)`**             | **`getAge(handler: (String) -> Unit)`**       |
| {% endtab %} |                                    |                                               |

{% tab title="Android (Java)" %}

| Property     | Getter                             | Setter                                        |
| ------------ | ---------------------------------- | --------------------------------------------- |
| Name         | **`setName(name: String)`**        | **`getName(handler: (String) -> Unit)`**      |
| Email        | **`setEmail(email: String)`**      | **`getEmail(handler: (String) -> Unit)`**     |
| Phone        | **`setPhone(phone: String)`**      | **`getPhone(handler: (String) -> Unit)`**     |
| Photo        | **`setPhoto(photo: String)`**      | **`getPhoto(handler: (String) -> Unit)`**     |
| Gender       | **`setGender(gender: DTDGender)`** | **`getGender(handler: (DTDGender) -> Void)`** |
| Age          | **`setAge(age: Int)`**             | **`getAge(handler: (String) -> Unit)`**       |
| {% endtab %} |                                    |                                               |

{% tab title=".NET Native + UWP" %}

| Property     | Getter                             | Setter                            |
| ------------ | ---------------------------------- | --------------------------------- |
| Name         | **`SetName(name: string)`**        | **`Task<string> GetName();`**     |
| Email        | **`SetEmail(email: string)`**      | **`Task<string> GetEmail()`**     |
| Phone        | **`SetPhone(phone: string)`**      | **`Task<string> GetPhone()`**     |
| Photo        | **`SetPhoto(photo: string)`**      | **`Task<string> GetPhoto()`**     |
| Gender       | **`SetGender(gender: DTDGender)`** | **`Task<DTDGender> GetGender()`** |
| Age          | **`SetAge(age: long)`**            | **`Task<long> GetAge()`**         |
| {% endtab %} |                                    |                                   |

{% tab title="Unity" %}
{% hint style="warning" %}
Attention! We strongly discourage the storage of personal user data! If you plan to pass this data, be sure to indicate this in the ‘Nutrition label’ when submitting the application to the App Store review.
{% endhint %}

| Property     | Getter                             | Setter                                         |
| ------------ | ---------------------------------- | ---------------------------------------------- |
| Name         | **`SetName(name: string)`**        | **`GetName(Action<string> onGetName)`**        |
| Email        | **`SetEmail(email: string)`**      | **`GetEmail(Action<string> onGetEmail)`**      |
| Phone        | **`SetPhone(phone: string)`**      | **`GetPhone(Action<string> onGetPhone)`**      |
| Photo        | **`SetPhoto(photo: string)`**      | **`GetPhoto(Action<string> onGetPhoto)`**      |
| Gender       | **`SetGender(gender: DTDGender)`** | **`GetGender(Action<DTDGender> onGetGender)`** |
| Age          | **`SetAge(age: long)`**            | **`GetAge(Action<string> onGetAge)`**          |
| {% endtab %} |                                    |                                                |

{% tab title="Web" %}

| Property     | Getter            | Setter                                         | Type   |
| ------------ | ----------------- | ---------------------------------------------- | ------ |
| Name         | **`getName()`**   | **`setName("John Doe")`**                      | String |
| Email        | **`getEmail()`**  | **`setEmail("email@me.com")`**                 | String |
| Phone        | **`getPhone()`**  | **`setPhone("+15555555555")`**                 | String |
| Photo        | **`getPhoto()`**  | **`setPhoto("https://domain.com/photo.jpg")`** | String |
| Gender       | **`getGender()`** | **`setGender(gender)`**                        |        |
| Age          | **`getAge()`**    | **`setAge(age)`**                              | Int    |
| {% endtab %} |                   |                                                |        |

{% tab title="Unreal" %}
{% hint style="warning" %}
Attention! We strongly discourage the storage of personal user data! If you plan to pass this data, be sure to indicate this in the ‘Nutrition label’ when submitting the application to the App Store review.
{% endhint %}

| Property       | Setter                              | Getter                                                                                                                                                                                        |
| -------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ***`Name`***   | **`SetName(name: FString)`**        | <ul><li><strong><code>GetName(delegate: FUserCardDynamicGetterStringDelegate)</code></strong></li><li><strong><code>GetName(delegate: FDTDGetterStringDelegate)</code></strong></li></ul>     |
| ***`Email`***  | **`SetEmail(email: FString)`**      | <ul><li><strong><code>GetEmail(delegate: FUserCardDynamicGetterStringDelegate)</code></strong></li><li><strong><code>GetEmail(delegate: FDTDGetterStringDelegate)</code></strong></li></ul>   |
| ***`Phone`***  | **`SetPhone(phone: FString)`**      | <ul><li><strong><code>GetPhone(delegate: FUserCardDynamicGetterStringDelegate)</code></strong></li><li><strong><code>GetPhone(delegate: FDTDGetterStringDelegate)</code></strong></li></ul>   |
| ***`Photo`***  | **`SetPhoto(photo: FString)`**      | <ul><li><strong><code>GetPhoto(delegate: FUserCardDynamicGetterStringDelegate)</code></strong></li><li><strong><code>GetPhoto(delegate: FDTDGetterStringDelegate)</code></strong></li></ul>   |
| ***`Gender`*** | **`SetGender(gender: EDTDGender)`** | <ul><li><strong><code>GetGender(delegate: FUserCardDynamicGetterGenderDelegate)</code></strong></li><li><strong><code>GetGender(delegate: FDTDGetterGenderDelegate)</code></strong></li></ul> |
| ***`Age`***    | **`SetAge(age: int64)`**            | <ul><li><strong><code>GetAge(delegate: FUserCardDynamicGetterLongDelegate)</code></strong></li><li><strong><code>GetAge(delegate: FDTDGetterLongDelegate)</code></strong></li></ul>           |

Example:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FyXlQ8T3miGmOep8GyAPF%2Fimage.png?alt=media\&token=79de16ba-91f4-4a94-8744-e305fbc4996b)

```cpp
UDTDUserCardBPLibrary::SetEmail("Email");
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FnShvLxlPtEbk6wVwvivN%2Fimage.png?alt=media\&token=3ffc4d9f-9d20-4a10-ae5e-7d4f1e73d7e9)

```cpp
auto onResult = new FDTDGetterStringDelegate();
onResult->BindLambda([](const FString& value)
{
	// Your code...
});
UDTDUserCardBPLibrary::GetEmail(*onResult);
```

{% endtab %}
{% endtabs %}

## Custom user property

Each devtodev project can have **up to 30 custom user properties**. User custom property values can be a number, a string (up to 500 symbols), or a boolean value.

{% hint style="warning" %}
Attention! We strongly recommend that you do not use these properties to transfer and store data that fits the definition of [personal data](https://gdpr-info.eu/issues/personal-data/)!
{% endhint %}

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}
This is how you can set properties on the current user profile:

```swift
DTDUserCard.set(key: "key for string value", value: "string value")
DTDUserCard.set(key: "key for int value", value: 10)
DTDUserCard.set(key: "key for double value", value: 12.5)
DTDUserCard.set(key: "key for bool value", value: true)
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

**`getValue(key: String, _completionHandler: @escaping (Any) -> Void)`**

```swift
DTDUserCard.getValue(key: "key for value") { value in
  // your code
}
```

{% hint style="info" %}
When using the **`getValue`** method, note that the **`Any`** return type will need to be cast to the data type you want.
{% endhint %}
{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}
This is how you can set properties on the current user profile:

```objectivec
[DTDUserCard setString:@"key for string value" value:@"string value"];
[DTDUserCard setInt:@"key for int value" value:10];
[DTDUserCard setDouble:@"key for double value" value:12.5];
[DTDUserCard setBool:@"key for bool value" value:true];
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

**`(void)getValueWithKey:(NSString *  _Nonnull)key :(void (^ _Nonnull)(id _Nullable))completionHandler;`**

```objectivec
[DTDUserCard getValueWithKey:@"key for value" :^(id object) {
  // your code
}];
```

{% hint style="info" %}
When using the **`getValue`** method, note that the **`Any`**&#x72;eturn type will need to be cast to the data type you want.
{% endhint %}
{% endtab %}

{% tab title="Android (Kotlin)" %}
This is how you can set properties on the current user profile:

```kotlin
DTDUserCard.set(key = "key for string value", value = "string value")
DTDUserCard.set(key = "key for int value", value = 10)
DTDUserCard.set(key = "key for double value", value = 12.5)
DTDUserCard.set(key = "key for bool value", value = true)
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

**`getValue(key: String, handler: (Any?) -> Unit)`**

```kotlin
DTDUserCard.getValue(key = "key for value") { value ->
  // your code
}
```

{% hint style="info" %}
When using the **`getValue`** method, note that the **`Any`**&#x72;eturn type will need to be cast to the data type you want.
{% endhint %}
{% endtab %}

{% tab title="Android (Java)" %}
This is how you can set properties on the current user profile:

```java
DTDUserCard.INSTANCE.set("key for string value", "string value");
DTDUserCard.INSTANCE.set("key for int value", 10);
DTDUserCard.INSTANCE.set("key for double value", 12.5);
DTDUserCard.INSTANCE.set("key for bool value", true);
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

**`getValue(key: String, handler: (Any?) -> Unit)`**

```java
DTDUserCard.INSTANCE.getValue("key for value", value ->
       // your code
       null
);j
```

{% hint style="info" %}
When using the **`getValue`** method, note that the **`Any`**&#x72;eturn type will need to be cast to the data type you want.
{% endhint %}
{% endtab %}

{% tab title=".NET Native + UWP" %}
This is how you can set properties on the current user profile:

```csharp
DTDUserCard.Set(key: "key for string value", value: "string value");
DTDUserCard.Set(key: "key for int value", value: 10);
DTDUserCard.Set(key: "key for double value", value: 12.5);
DTDUserCard.Set(key: "key for bool value", value: true);
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

```csharp
var value = await DTDUserCard.Get(key: "key for value");
switch (value)
{
    case bool boolValue:
        break;
    case long longValue:
        break;
    case double doubleValue:
        break;
    case string stringValue:
        break;
}
```

{% hint style="info" %}
When using the **`Get`** method, note that the **`object`** return type will need to be cast to the data type you want.
{% endhint %}
{% endtab %}

{% tab title="Unity" %}
This is how you can set properties on the current user profile:

```csharp
DTDUserCard.Set(key: "key for string value", value: "string value");
DTDUserCard.Set(key: "key for int value", value: 10);
DTDUserCard.Set(key: "key for double value", value: 12.5);
DTDUserCard.Set(key: "key for bool value", value: true);
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

```csharp
DTDUserCard.GetValue("key", value =>
{
    switch (value)
    {
    case bool boolValue:
        break;
    case long longValue:
        break;
    case double doubleValue:
        break;
    case string stringValue:
        break;
    }             
})
DTDUserCard.Get(key: "key for value");
```

{% hint style="info" %}
When using the **`Get`** method, note that the **`object`** return type will need to be cast to the data type you want.
{% endhint %}
{% endtab %}

{% tab title="Web" %}
This is how you can set properties on the current user profile:

```javascript
analytics.user.set("key for string value",  "string value")
analytics.user.set("key for int value", 10)
analytics.user.set("key for double value", 12.5)
analytics.user.set("key for bool value", true)
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use the method:

```javascript
analytics.user.getValue("key for value") 
```

{% endtab %}

{% tab title="Unreal" %}
This is how you can set properties on the current user profile:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FcbuIjckIM3Vxc9FK8J0D%2Fimage.png?alt=media\&token=caa6d530-43a9-4c82-b8ca-4d428baf12f4)

| Arguments   | Type    | Description      |
| ----------- | ------- | ---------------- |
| ***key***   | FString | Parameter key.   |
| ***value*** | bool    | Parameter value. |

```cpp
UDTDUserCardBPLibrary::SetBool("BoolKey", true);
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FwZxt1gzSCUFvxCD1RuhZ%2Fimage.png?alt=media\&token=308be4c4-86ec-4d28-a65b-05a2867a11e5)

| Arguments   | Type    | Description      |
| ----------- | ------- | ---------------- |
| ***key***   | FString | Parameter key.   |
| ***value*** | float   | Parameter value. |

```cpp
UUDTDUserCardBPLibrary::SetFloat("FloatKey", 3.333);
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FqtBaHYUO22nR8E6aCfrX%2Fimage.png?alt=media\&token=8bee1b6e-2d8d-4c84-80a9-f3417ace6d5f)

| Arguments   | Type    | Description      |
| ----------- | ------- | ---------------- |
| ***key***   | FString | Parameter key.   |
| ***value*** | int64   | Parameter value. |

```cpp
UDTDUserCardBPLibrary::SetLong("LongKey", 1000);
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F2Lz7bZyAhBZavFbTxJH7%2Fimage.png?alt=media\&token=75534cec-8a24-4316-bd44-6e9131b0c281)

| Arguments   | Type    | Description      |
| ----------- | ------- | ---------------- |
| ***key***   | FString | Parameter key.   |
| ***value*** | FString | Parameter value. |

```cpp
UDTDUserCardBPLibrary::SetString("StringKey", "StringValue");
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current value stored in the user profile on the SDK, you need to use methods:

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F1m4qI10q4RbEnDiHPgs9%2Fimage.png?alt=media\&token=a8828463-2c6b-420d-9f08-b1e8cd48e8e9)

| Arguments      | Type                                                                                                       | Description    |
| -------------- | ---------------------------------------------------------------------------------------------------------- | -------------- |
| ***key***      | FString                                                                                                    | Parameter key. |
| ***onResult*** | <ul><li>FUserCardDynamicGetterOptionalBoolDelegate</li><li>FDTDGetterOptionalBoolWithKeyDelegate</li></ul> | Callback.      |

```cpp
FString key = FString(TEXT("Key"));
auto onResult = new FDTDGetterOptionalBoolWithKeyDelegate();
onResult->BindLambda([](bool success, const FString& key, bool value)
{
	// Your code...
});
UDTDUserCardBPLibrary::TryGetBool(key, *onResult);
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FLyCkgM3Ub033vVup4nlB%2Fimage.png?alt=media\&token=c7f83798-2584-458f-a7e7-908a9b741a60)

| Arguments      | Type                                                                                                         | Description    |
| -------------- | ------------------------------------------------------------------------------------------------------------ | -------------- |
| ***key***      | FString                                                                                                      | Parameter key. |
| ***onResult*** | <ul><li>FUserCardDynamicGetterOptionalFloatDelegate</li><li>FDTDGetterOptionalFloatWithKeyDelegate</li></ul> | Callback.      |

```cpp
FString key = FString(TEXT("Key"));
auto onResult = new FDTDGetterOptionalFloatWithKeyDelegate();
onResult->BindLambda([](bool success, const FString& key, float value)
{
	// Your code...
});
UDTDUserCardBPLibrary::TryGetFloat(key, *onResult);
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FhO63NCbDOFdMFEbPPREy%2Fimage.png?alt=media\&token=abe918f8-1f81-4b4c-b66d-54af2f95d432)

| Arguments      | Type                                                                                                       | Description    |
| -------------- | ---------------------------------------------------------------------------------------------------------- | -------------- |
| ***key***      | FString                                                                                                    | Parameter key. |
| ***onResult*** | <ul><li>FUserCardDynamicGetterOptionalLongDelegate</li><li>FDTDGetterOptionalLongWithKeyDelegate</li></ul> | Callback.      |

```cpp
FString key = FString(TEXT("Key"));
auto onResult = new FDTDGetterOptionalIntWithKeyDelegate();
onResult->BindLambda([](bool success, const FString& key, int64 value)
{
	// Your code...
});
UDTDUserCardBPLibrary::TryGetLong(key, *onResult);
```

&#x20;

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F9qTN8UosXG1EXaj46mSQ%2Fimage.png?alt=media\&token=a4efe521-c2e3-4227-8975-8e9a19e793ae)

| Arguments      | Type                                                                                                           | Description    |
| -------------- | -------------------------------------------------------------------------------------------------------------- | -------------- |
| ***key***      | FString                                                                                                        | Parameter key. |
| ***onResult*** | <ul><li>FUserCardDynamicGetterOptionalStringDelegate</li><li>FDTDGetterOptionalStringWithKeyDelegate</li></ul> | Callback.      |

```cpp
FString key = FString(TEXT("Key"));
auto onResult = new FDTDGetterOptionalStringWithKeyDelegate();
onResult->BindLambda([](bool success, const FString& key, const FString& value)
{
	// Your code...
});
UDTDUserCardBPLibrary::TryGetString(key, *onResult);
```

{% endtab %}

{% tab title="Godot" %}
This is how you can set properties on the current user profile:

```gdscript
DTDUserCard.SetString("key for string value", "string value")
DTDUserCard.SetInt("key for int value", 10)
DTDUserCard.SetFloat("key for double value", 12.5)
DTDUserCard.SetBool("key for bool value", true)
```

{% hint style="info" %}
It is important to remember that the key for custom user properties has a length limit. If the limit is exceeded (from 1 to 64 characters), the key will be truncated to the maximum allowed length
{% endhint %}

To get the current values stored in the user profile on the SDK, you need to use the methods:

**`TryGetBool(key: String, callback: Callable)`**

**`TryGetFloat(key: String, callback: Callable)`**

**`TryGetInt(key: String, callback: Callable)`**

**`TryGetString(key: String, callback: Callable`**

```gdscript
DTDUserCard.TryGetInt("intKey", getIntHandler)
DTDUserCard.TryGetString("intKey", getStringHandler)
DTDUserCard.TryGetFloat("intKey", getFloatHandler)
DTDUserCard.TryGetBool("intKey", getBoolHandler)

func getIntHandler(isValid: bool, value: int):
	print("isValid = " + str(isValid) + " integer = " + str(value))

func getStringHandler(isValid: bool, value: String):
	print("isValid = " + str(isValid) + " string = " + value)
	
func getFloatHandler(isValid: bool, value: float):
	print("isValid = " + str(isValid) + " float = " + str(value))
	
func getBoolHandler(isValid: bool, value: bool):
	print("isValid = " + str(isValid) + " bool = " + str(value))
```

{% hint style="info" %}
The **isValid** parameter is responsible for the presence of the requested key in the user card.
{% endhint %}
{% endtab %}
{% endtabs %}

## Unset user property

It removes a property or a list of properties and their values from the current user profile.&#x20;

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}

```swift
DTDUserCard.unset(property: "key for string value")
DTDUserCard.unset(properties: ["key for string value", 
                               "key for int value"])
```

{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}

```objectivec
[DTDUserCard unsetProperty:@"key for string value"];
[DTDUserCard unset:@[@"key for string value",
                     @"key for int value"]];
```

{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
DTDUserCard.unset(property = "key for string value")
DTDUserCard.unset(property = listOf("key for string value", "key for int value"))
```

{% endtab %}

{% tab title="Android (Java)" %}

```java
DTDUserCard.INSTANCE.unset( "key for string value");

ArrayList<String> properties = new ArrayList<>();
properties.add("key for string value");
properties.add("key for int value");
DTDUserCard.INSTANCE.unset(properties);
```

{% endtab %}

{% tab title=".NET Native + UWP" %}

```csharp
DTDUserCard.Unset(keys: "key 1");
DTDUserCard.Unset(keys: "key 1", "key 2", "key 3");
```

{% endtab %}

{% tab title="Unity" %}

```csharp
DTDUserCard.Unset(keys: "key 1");
DTDUserCard.Unset(keys: "key 1", "key 2", "key 3");
```

{% endtab %}

{% tab title="Web" %}

```javascript
analytics.user.unset("key for string value")
analytics.user.unset(["key for string value", "key for int value"])
```

{% endtab %}

{% tab title="Unreal" %}
![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2FYgALca0QR8kANPhenrw2%2Fimage.png?alt=media\&token=a159797a-66fb-4cc1-9f39-6f8ce462f2f9)

| Arguments | Type    | Description    |
| --------- | ------- | -------------- |
| ***key*** | FString | Parameter key. |

```cpp
UDTDUserCardBPLibrary::Unset("Key");
```

![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2Flh2xvvcL0AICZhz8rAXu%2Fimage.png?alt=media\&token=93a81426-2510-4742-9e98-c555675fa043)

| Arguments  | Type             | Description     |
| ---------- | ---------------- | --------------- |
| ***keys*** | TArray\<FString> | Parameter keys. |

```cpp
TArray<FString> keys;
keys.Add("Key1");
keys.Add("Key2");
UDTDUserCardBPLibrary::UnsetArray(keys);
```

{% endtab %}

{% tab title="Godot" %}

```gdscript
DTDUserCard.Unset("intKey")

var arrayOfKeys = ["floatKey", "boolKey"]
DTDUserCard.UnsetArray(arrayOfKeys)
```

{% endtab %}
{% endtabs %}

## Unset all user properties

To remove all properties from the user card, use:

{% tabs fullWidth="true" %}
{% tab title="iOS+macOS (Swift)" %}

```swift
DTDUserCard.clearUser()
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`setCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="iOS+macOS (Objective-C)" %}

```objectivec
[DTDUserCard clearUser];
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`setCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="Android (Kotlin)" %}

```kotlin
DTDUserCard.clearUser()
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`setCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="Android (Java)" %}

```java
DTDUserCard.INSTANCE.clearUser();
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`setCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title=".NET Native + UWP" %}

```csharp
DTDUserCard.ClearUser();
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`SetCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="Unity" %}

```csharp
DTDUserCard.ClearUser();
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`SetCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="Web" %}

```javascript
analytics.user.clearUser()
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`setCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="Unreal" %}
![Blueprint](https://2105883905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LnGcP_ZeRJ1ipj9O8dF%2Fuploads%2F9Irupasa2wVbJCmapX7O%2Fimage.png?alt=media\&token=0b8aceeb-f347-4cbc-97ba-72c5316807c8)

```cpp
UDTDUserCardBPLibrary::ClearUser();
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`SetCheater`**](#cheater) method.
{% endhint %}
{% endtab %}

{% tab title="Godot" %}

```gdscript
DTDUserCard.ClearUser()
```

{% hint style="info" %}
Keep in mind that the ***cheater*** mark is not cleared from the user card; you can only uncheck the mark manually using the [**`setCheater`**](#cheater) method.
{% endhint %}
{% endtab %}
{% endtabs %}
