Skip to content

FAnalyticsProviderTreasureData

Overview

class FAnalyticsProviderTreasureData;

Treasure Data Unreal Engine Analytics Provider plugin. This SDK will immediately upload events upon adding them. No local buffer used.

Public Types

enum FAnalyticsRegion

EnumeratorValueDescription
US01USA - us01.records.in.treasuredata.com
AP01Japan - ap01.records.in.treasuredata.com
AP02Korea - ap02.records.in.treasuredata.com
EU01Europe - eu01.records.in.treasuredata.com.

Check your organizations settings to verify the correct selection.

Public Functions

Create

static inline TSharedPtr< IAnalyticsProvider > Create(
    const FString Key,
    const FString DBName,
    FAnalyticsRegion Region
)

Create Treasure Data Instance. All events will be recorded to two tables, Sessions and Events.

ParamDescription
KeyWrite only API Key
DBNameDatabase Name to log data to. Maximum length of 120 characters.
RegionTD Account Region

Return: TD Analytics Provider Instance


Destroy

static inline void Destroy()

Remove all configuration data from the Treasure Data instance.


StartSession

virtual bool StartSession(
    const TArray< FAnalyticsEventAttribute > & Attributes
) override

Start the session

ParamDescription
AttributesAdditional event attributes

Return: bool true if session started successfully


EndSession

virtual void EndSession() override

End the session


SetUserID

virtual void SetUserID(
    const FString & InUserID
) override

Set the ID of the User

ParamDescription
InUserIDString representing the User ID. Preferably Unique.

GetUserID

virtual FString GetUserID() const override

Get the ID of the User

Return: FString string representing the User ID


GetSessionID

virtual FString GetSessionID() const override

Get the current session ID

Return: FString string representing the current session ID


SetSessionID

virtual bool SetSessionID(
    const FString & InSessionID
) override

Set the Session ID of the User

ParamDescription
InSessionIDsession id as a string

Return: bool true if session id set successfully


RecordEvent

virtual void RecordEvent(
    const FString & EventName,
    const TArray< FAnalyticsEventAttribute > & Attributes
) override

Record an event

ParamDescription
EventNameName of Event
AttributesAttributes as an array

RecordItemPurchase

virtual void RecordItemPurchase(
    const FString & ItemId,
    const FString & Currency,
    int PerItemCost,
    int ItemQuantity
) override

Record an item purchase

ParamDescription
ItemIdstring representing ID of item
Currencystring representing ID of currency
PerItemCostinteger cost of item
ItemQuantitynumber of items

RecordCurrencyPurchase

virtual void RecordCurrencyPurchase(
    const FString & GameCurrencyType,
    int GameCurrencyAmount,
    const FString & RealCurrencyType,
    float RealMoneyCost,
    const FString & PaymentProvider
) override

Record purchse of currency

ParamDescription
GameCurrencyTypeType of currency as a string
GameCurrencyAmountAmount of currency as a integer
RealCurrencyTypeCurrency type as a string
RealMoneyCostCost in Real dollars as a float
PaymentProviderPayment Provider as a string

RecordCurrencyGiven

virtual void RecordCurrencyGiven(
    const FString & GameCurrencyType,
    int GameCurrencyAmount
) override

Record the currency given to the user

ParamDescription
GameCurrencyTypeType of in-game currency as a string
GameCurrencyAmountAmount of in-game currency as an integer

SetBuildInfo

virtual void SetBuildInfo(
    const FString & InBuildInfo
) override

Set the build information

ParamDescription
InBuildInfoBuild information as a string

SetGender

virtual void SetGender(
    const FString & InGender
) override

Set the Gender of the User

ParamDescription
InGenderString representing the gender

SetLocation

virtual void SetLocation(
    const FString & InLocation
) override

Set the Location of the User

ParamDescription
InLocationString representing the location of the user

SetAge

virtual void SetAge(
    const int32 InAge
) override

Set the Age of the User

ParamDescription
InAgeInteger representing the age of the user

RecordItemPurchase

virtual void RecordItemPurchase(
    const FString & ItemId,
    int ItemQuantity,
    const TArray< FAnalyticsEventAttribute > & EventAttrs
) override

Record the purchase of an in-game item

ParamDescription
ItemIdID of the item as a string
ItemQuantityNumber of items as an integer
EventAttrsAdditional event attributes

RecordCurrencyPurchase

virtual void RecordCurrencyPurchase(
    const FString & GameCurrencyType,
    int GameCurrencyAmount,
    const TArray< FAnalyticsEventAttribute > & EventAttrs
) override

Record purchase of in-game currency

ParamDescription
GameCurrencyTypeType of currency in game as a string
GameCurrencyAmountAmount of currency as an integer
EventAttrsAdditional event attributes

RecordCurrencyGiven

virtual void RecordCurrencyGiven(
    const FString & GameCurrencyType,
    int GameCurrencyAmount,
    const TArray< FAnalyticsEventAttribute > & EventAttrs
) override

Record currency given to user in-game

ParamDescription
GameCurrencyTypeType of currency
GameCurrencyAmountAmount of currency
EventAttrsAdditional event attributes

RecordError

virtual void RecordError(
    const FString & Error,
    const TArray< FAnalyticsEventAttribute > & EventAttrs
) override

When things go wrong, record an error

ParamDescription
ErrorError event name
EventAttrsError event attributes

RecordProgress

virtual void RecordProgress(
    const FString & ProgressType,
    const FString & ProgressHierarchy,
    const TArray< FAnalyticsEventAttribute > & EventAttrs
) override

Record progress of user

ParamDescription
ProgressTypeType of progress as a string
ProgressHierarchyHierarchy of progress as a string
EventAttrsAdditional event attributes

AddEventAttribute

void AddEventAttribute(
    const FString & EventName,
    const FString & EventValue
)

Add basic event with value

ParamDescription
EventNameName of Event
EventValueValue of event

ClearEventAttributes

void ClearEventAttributes()

Clear event attributes


GetRegion

inline FAnalyticsRegion GetRegion()

Return the AnalyticsRegion currently set for the object instance.


GetAPIURL

inline FString GetAPIURL()

Convenience function to transform API Endpoint enumerations into Postback API address string.

Return: string with the Postback API endpoint