FAnalyticsProviderTreasureData

Overview

Copy
Copied
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

Enumerator Value Description
US01 USA - us01.records.in.treasuredata.com
AP01 Japan - ap01.records.in.treasuredata.com
AP02 Korea - ap02.records.in.treasuredata.com
EU01 Europe - eu01.records.in.treasuredata.com.

Check your organizations settings to verify the correct selection.

Public Functions

Create

Copy
Copied
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.

Param Description
Key Write only API Key
DBName Database Name to log data to. Maximum length of 120 characters.
Region TD Account Region

Return: TD Analytics Provider Instance


Destroy

Copy
Copied
static inline void Destroy()

Remove all configuration data from the Treasure Data instance.


StartSession

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

Start the session

Param Description
Attributes Additional event attributes

Return: bool true if session started successfully


EndSession

Copy
Copied
virtual void EndSession() override

End the session


SetUserID

Copy
Copied
virtual void SetUserID(
    const FString & InUserID
) override

Set the ID of the User

Param Description
InUserID String representing the User ID. Preferably Unique.

GetUserID

Copy
Copied
virtual FString GetUserID() const override

Get the ID of the User

Return: FString string representing the User ID


GetSessionID

Copy
Copied
virtual FString GetSessionID() const override

Get the current session ID

Return: FString string representing the current session ID


SetSessionID

Copy
Copied
virtual bool SetSessionID(
    const FString & InSessionID
) override

Set the Session ID of the User

Param Description
InSessionID session id as a string

Return: bool true if session id set successfully


RecordEvent

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

Record an event

Param Description
EventName Name of Event
Attributes Attributes as an array

RecordItemPurchase

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

Record an item purchase

Param Description
ItemId string representing ID of item
Currency string representing ID of currency
PerItemCost integer cost of item
ItemQuantity number of items

RecordCurrencyPurchase

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

Record purchse of currency

Param Description
GameCurrencyType Type of currency as a string
GameCurrencyAmount Amount of currency as a integer
RealCurrencyType Currency type as a string
RealMoneyCost Cost in Real dollars as a float
PaymentProvider Payment Provider as a string

RecordCurrencyGiven

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

Record the currency given to the user

Param Description
GameCurrencyType Type of in-game currency as a string
GameCurrencyAmount Amount of in-game currency as an integer

SetBuildInfo

Copy
Copied
virtual void SetBuildInfo(
    const FString & InBuildInfo
) override

Set the build information

Param Description
InBuildInfo Build information as a string

SetGender

Copy
Copied
virtual void SetGender(
    const FString & InGender
) override

Set the Gender of the User

Param Description
InGender String representing the gender

SetLocation

Copy
Copied
virtual void SetLocation(
    const FString & InLocation
) override

Set the Location of the User

Param Description
InLocation String representing the location of the user

SetAge

Copy
Copied
virtual void SetAge(
    const int32 InAge
) override

Set the Age of the User

Param Description
InAge Integer representing the age of the user

RecordItemPurchase

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

Record the purchase of an in-game item

Param Description
ItemId ID of the item as a string
ItemQuantity Number of items as an integer
EventAttrs Additional event attributes

RecordCurrencyPurchase

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

Record purchase of in-game currency

Param Description
GameCurrencyType Type of currency in game as a string
GameCurrencyAmount Amount of currency as an integer
EventAttrs Additional event attributes

RecordCurrencyGiven

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

Record currency given to user in-game

Param Description
GameCurrencyType Type of currency
GameCurrencyAmount Amount of currency
EventAttrs Additional event attributes

RecordError

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

When things go wrong, record an error

Param Description
Error Error event name
EventAttrs Error event attributes

RecordProgress

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

Record progress of user

Param Description
ProgressType Type of progress as a string
ProgressHierarchy Hierarchy of progress as a string
EventAttrs Additional event attributes

AddEventAttribute

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

Add basic event with value

Param Description
EventName Name of Event
EventValue Value of event

ClearEventAttributes

Copy
Copied
void ClearEventAttributes()

Clear event attributes


GetRegion

Copy
Copied
inline FAnalyticsRegion GetRegion()

Return the AnalyticsRegion currently set for the object instance.


GetAPIURL

Copy
Copied
inline FString GetAPIURL()

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

Return: string with the Postback API endpoint