Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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.

We recommend that you pass this parameter in the initialization configuration (userId property of an instance of theDTDAnalyticsConfiguration 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.

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

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

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

DTDAnalytics.getUserId { userId in
  // your code
}

We recommend that you pass this parameter in the initialization configuration (userId property of an instance of theDTDAnalyticsConfiguration 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.

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

[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;

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

We recommend that you pass this parameter in the initialization configuration (userId property of an instance of theDTDAnalyticsConfiguration 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.

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

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

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

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

We recommend that you pass this parameter in the initialization configuration (userId property of an instance of theDTDAnalyticsConfiguration 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.

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

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

We recommend that you pass this parameter in the initialization configuration (userId property of an instance of theDTDAnalyticsConfiguration 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.

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

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

We recommend that you pass this parameter in the initialization configuration (userId property of an instance of theDTDAnalyticsConfiguration 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.

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

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

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.

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

To get the current value of the user ID, use the getUserIdmethod

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.

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

Blueprint

Arguments
Type
Description

userId

FString

User ID.

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

Blueprint

Arguments
Type
Description

onResult

  • FAnalyticsDynamicGetterStringDelegate

  • FDTDGetterStringDelegate

Callback

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.

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

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

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.

Blueprint

Arguments
Type
Description

fromUserId

FString

From user ID

toUserId

FString

To user ID

Current user level

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

To set the current value to the user level, use setCurrentLevel(currentLevel: Int) method:

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

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

To set the current value to the user level, use (void)currentLevel:(NSInteger)currentLevel; method:

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

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

To set the current value to the user level, use method:

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

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

To set the current value to the user level, use method:

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

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

To set the current value to the user level, use method:

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

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

To set the current value to the user level, use method:

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

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

To set the current value to the user level, use method:

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

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

To set the current value to the user level, use method:

Blueprint

Arguments
Type
Description

level

int32

Current level.

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

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

Blueprint

Arguments
Type
Description

onResult

  • FAnalyticsDynamicGetterIntDelegate

  • FDTDGetterIntDelegate

Callback

To set the current value to the user level, use SetCurrentLevel(level: int) method:

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

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

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.

Blueprint
Arguments
Type
Description

cheater

bool

Cheater flag

Tester

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

Blueprint
Arguments
Type
Description

tester

bool

Tester flag

Reserved user properties

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

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) { }];

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)

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)

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()

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)

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

Property
Setter
Getter

Name

SetName(name: FString)

  • GetName(delegate: FUserCardDynamicGetterStringDelegate)

  • GetName(delegate: FDTDGetterStringDelegate)

Email

SetEmail(email: FString)

  • GetEmail(delegate: FUserCardDynamicGetterStringDelegate)

  • GetEmail(delegate: FDTDGetterStringDelegate)

Phone

SetPhone(phone: FString)

  • GetPhone(delegate: FUserCardDynamicGetterStringDelegate)

  • GetPhone(delegate: FDTDGetterStringDelegate)

Photo

SetPhoto(photo: FString)

  • GetPhoto(delegate: FUserCardDynamicGetterStringDelegate)

  • GetPhoto(delegate: FDTDGetterStringDelegate)

Gender

SetGender(gender: EDTDGender)

  • GetGender(delegate: FUserCardDynamicGetterGenderDelegate)

  • GetGender(delegate: FDTDGetterGenderDelegate)

Age

SetAge(age: int64)

  • GetAge(delegate: FUserCardDynamicGetterLongDelegate)

  • GetAge(delegate: FDTDGetterLongDelegate)

Example:

Blueprint
Blueprint

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.

This is how you can set properties on the current user profile:

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

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)

When using the getValue method, note that the Any return type will need to be cast to the data type you want.

This is how you can set properties on the current user profile:

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

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;

When using the getValue method, note that the Anyreturn type will need to be cast to the data type you want.

This is how you can set properties on the current user profile:

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

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)

When using the getValue method, note that the Anyreturn type will need to be cast to the data type you want.

This is how you can set properties on the current user profile:

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

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)

When using the getValue method, note that the Anyreturn type will need to be cast to the data type you want.

This is how you can set properties on the current user profile:

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

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

When using the Get method, note that the object return type will need to be cast to the data type you want.

This is how you can set properties on the current user profile:

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

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

When using the Get method, note that the object return type will need to be cast to the data type you want.

This is how you can set properties on the current user profile:

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

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

This is how you can set properties on the current user profile:

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

value

bool

Parameter value.

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

value

float

Parameter value.

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

value

int64

Parameter value.

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

value

FString

Parameter value.

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

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

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

onResult

  • FUserCardDynamicGetterOptionalBoolDelegate

  • FDTDGetterOptionalBoolWithKeyDelegate

Callback.

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

onResult

  • FUserCardDynamicGetterOptionalFloatDelegate

  • FDTDGetterOptionalFloatWithKeyDelegate

Callback.

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

onResult

  • FUserCardDynamicGetterOptionalLongDelegate

  • FDTDGetterOptionalLongWithKeyDelegate

Callback.

Blueprint
Arguments
Type
Description

key

FString

Parameter key.

onResult

  • FUserCardDynamicGetterOptionalStringDelegate

  • FDTDGetterOptionalStringWithKeyDelegate

Callback.

This is how you can set properties on the current user profile:

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

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

The isValid parameter is responsible for the presence of the requested key in the user card.

Unset user property

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

Blueprint

Arguments
Type
Description

key

FString

Parameter key.

Blueprint

Arguments
Type
Description

keys

TArray<FString>

Parameter keys.

Unset all user properties

To remove all properties from the user card, use:

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the setCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the setCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the setCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the setCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the SetCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the SetCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the setCheater method.

Blueprint

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the SetCheater method.

Keep in mind that the cheater mark is not cleared from the user card; you can only uncheck the mark manually using the setCheater method.

Last updated

Was this helpful?