User profile. devtodev SDK for UE4

Additionally to basic methods, you can observe and change the user profiles data. User profile is the set or properties describing the user. User properties can be divided into 4 groups:

  1. Crossplatform or custom user identifier. If this identifier is not set by developer, then the device identifier is used.
  2. Automatically collected properties, including data about user's device, geography, app version, SDK, and some other data which can be received from SDK.
  3. Default set of user properties, which can be set by developer. The set of this parameters works with separate methods. This set includes the data of user's name, sex, age, e-mail, phone-number and url of user picture. Also this set includes the mark of user as cheater.
  4. Custom set of user properties. In this case developer sets any user data he/she needs to know. The data is set in key-value format and can be numeric, string, array or boolean.

You can segment users by all the properties in My Apps section of an application.

Cross-platform user ID

This method is used for user initialization in the applications which are the parts of cross-platform project.

We recommend you to apply this method before the SDK initialization, otherwise the user identifier from the previous session will be used since the SDK initialization moment till the setUserID method call.

If your cross-platform application supposes to be used without cross-platform authorization, don't use the setUserID method or use the empty string ("") as the user identifier. SDK will assign the unique identifier to user. This identifier will we used until the real cross-platform identifier assigns to the user.

Attention! If your application allows user to relogin (changing the user during the working session of application), then the setUserID method should be called just after the authorization. You don't need to call the SDK initialization one more time.

Blueprint

Field Type Description
User Id FString Unique cross-platform user id

Code

// Initializes the user with the specified cross-platform identifier
// FString activeUserId - unique cross-platform user id

FAnalytics::Get().GetDefaultConfiguredProvider()->SetUserID(FString activeUserId);

‚ÄčTo see which identifier is used at the moment:

Blueprint

Code

// Returns current cross-platform user id

FAnalytics::Get().GetDefaultConfiguredProvider()->GetUserID();

Replace Cross-platform user ID

If it is possible to replace the user identifier in your application (say, to make changes in the login/user id for particular user), use this method at the moment of replacing the identifier.
Attention! Don't use this method if you're going to perform the user's relogin.

Blueprint

Field Type Description
From FString Current user Id
To FString New user Id

Code

// Replaces cross-platform user id
// FString from - current user id
// FString to - new user id

UDevToDevBlueprintFunctionLibrary::ReplaceUserId(const FString& from, const FString& to);

Current user level

This method is used in cross-platform applications and applications with data synchronization. 

This method is required for user's level data initialization. We recommend you to use the setCurrentLevel method just after the user initialization (using the setUserID method).

Attention! Don't use the setCurrentLevel method at the moment of user's level up. We recommend you to use the levelUp method in this case.

Blueprint

Field Type Description
Level int32 Current user level

Code

// Initializes the current user level
// int32 level - current user level

UDevToDevBlueprintFunctionLibrary::SetCurrentLevel(int32 level)

Cheater

In case you have your own methods of determining cheaters in the application, you can have such users marked. Payments made by them will not be taken into account in the statistics.

Blueprint

Field Type Description
isCheater bool True if user is a cheater

Code

UPeopleLibrary::Cheater(bool cheater);

Name

User's name. Default user profile property.

Blueprint

--

Field Type Description
Name FString User's name
 

Code

UPeopleLibrary::Name(const FString& name);

Age

User's age in years. Default user profile property.

Blueprint

Field Type Description
Age int32 User's age in years

Code

UPeopleLibrary::Age(int32 age);

Gender

User's gender. Default user profile property.

Blueprint

Field Type Description
Gender FString

User's gender ('male', 'female', 'unknown')

Code

UPeopleLibrary::Gender(const FString& InGender);

E-mail

User's e-mail. Default user profile property.

Blueprint

Field Type Description
Email FString User's e-mail

Code

UPeopleLibrary::Email(const FString& email);

Phone number

User's phone. Default user profile property.

Blueprint

Field Type Description
Phone FString User's phone

Code

UPeopleLibrary::Phone(const FString& phone);

Photo

User's photo URL. Default user profile property.

Blueprint

Field Type Description
 Photo FString User's photo URL.

Code

UPeopleLibrary::Photo(const FString& photo);

Custom user property

Set properties on the current user profile.

BLueprint

Field Type Description

Attributes

TArray<FAnalyticsEventAttr>

Key-value array to set custom property, where key is a user property name, value is a property value

Code

UPeopleLibrary::SetUserData(const TArray<FAnalyticsEventAttr>& Attributes);

Increment of the custom property

Increments the given numeric properties by the given values.

Blueprint

Field Type Description

Attributes

TArray<FAnalyticsEventAttr>

Key-value array, where key is a user property name, value is increment step

Code

UPeopleLibrary::IncrementUserData(const TArray<FAnalyticsEventAttr>& Attributes);

Removing of the custom property

Removes a property or a list of properties and their values from the current user's profile.

Blueprint

Field Type Description

Attributes

TArray<FString>

An array of property names to be removed.

Code

UPeopleLibrary::UnsetUserData(const TArray<FString>& Attributes);

Clearing of the all custom properties

Blueprint

Code

UPeopleLibrary::ClearUserData();

 

Basic methods
Secondary methods