engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
IAnalyticsProvider类 参考abstract

Generic interface for an analytics provider. 更多...

#include <IAnalyticsProvider.h>

+ 类 IAnalyticsProvider 继承关系图:

Public 成员函数

virtual void EndSession ()=0
 Ends the session. 更多...
 
virtual void FlushEvents ()=0
 Flush any cached events to the analytics provider. 更多...
 
virtual FString GetSessionID () const =0
 Gets the opaque session identifier string for the provider.
 
virtual FString GetUserID () const =0
 Gset the current UserID. 更多...
 
virtual void RecordCurrencyGiven (const FString &GameCurrencyType, int GameCurrencyAmount)
 Record a gift of in-game currency from the game itself. 更多...
 
virtual void RecordCurrencyGiven (const FString &GameCurrencyType, int GameCurrencyAmount, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 Record a gift of in-game currency from the game itself. 更多...
 
virtual void RecordCurrencyPurchase (const FString &GameCurrencyType, int GameCurrencyAmount)
 Record an in-game purchase of a an item. 更多...
 
virtual void RecordCurrencyPurchase (const FString &GameCurrencyType, int GameCurrencyAmount, const FString &RealCurrencyType, float RealMoneyCost, const FString &PaymentProvider)
 Record a purchase of in-game currency using real-world money. 更多...
 
virtual void RecordCurrencyPurchase (const FString &GameCurrencyType, int GameCurrencyAmount, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 Record a purchase of in-game currency using real-world money. 更多...
 
virtual void RecordError (const FString &Error)
 Records an error that has happened in the game 更多...
 
virtual void RecordError (const FString &Error, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 Records an error that has happened in the game 更多...
 
void RecordEvent (const FString &EventName)
 Overload for RecordEvent that takes no parameters 更多...
 
void RecordEvent (const FString &EventName, const FAnalyticsEventAttribute &Attribute)
 Overload for RecordEvent that takes a single attribute 更多...
 
void RecordEvent (const FString &EventName, const FString &ParamName, const FString &ParamValue)
 Overload for RecordEvent that takes a single name/value pair 更多...
 
virtual void RecordEvent (const FString &EventName, const TArray< FAnalyticsEventAttribute > &Attributes)=0
 Records a named event with an array of attributes 更多...
 
virtual void RecordItemPurchase (const FString &ItemId, const FString &Currency, int PerItemCost, int ItemQuantity)
 Record an in-game purchase of a an item. 更多...
 
void RecordItemPurchase (const FString &ItemId, int ItemQuantity)
 Record an in-game purchase of a an item. 更多...
 
virtual void RecordItemPurchase (const FString &ItemId, int ItemQuantity, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 Record an in-game purchase of a an item. 更多...
 
virtual void RecordProgress (const FString &ProgressType, const FString &ProgressHierarchy)
 Record a player progression event that has happened in the game 更多...
 
virtual void RecordProgress (const FString &ProgressType, const FString &ProgressHierarchy, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 Record a player progression event that has happened in the game 更多...
 
virtual void RecordProgress (const FString &ProgressType, const TArray< FString > &ProgressHierarchy, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 Record a player progression event that has happened in the game 更多...
 
virtual void SetAge (const int32 InAge)
 Sets the location the game believes the user is playing in as part of the session
 
virtual void SetBuildInfo (const FString &InBuildInfo)
 Sets a user defined string as the build information/version for the session
 
virtual void SetGender (const FString &InGender)
 Sets the gender the game believes the user is as part of the session
 
virtual void SetLocation (const FString &InLocation)
 Sets the location the game believes the user is playing in as part of the session
 
virtual bool SetSessionID (const FString &InSessionID)=0
 Sets the session ID of the analytics session. 更多...
 
virtual void SetUserID (const FString &InUserID)=0
 Set the UserID for use with analytics. 更多...
 
bool StartSession ()
 Starts a session. 更多...
 
bool StartSession (const FAnalyticsEventAttribute &Attribute)
 Overload for StartSession that takes a single attribute 更多...
 
bool StartSession (const FString &ParamName, const FString &ParamValue)
 Overload for StartSession that takes a single name/value pair 更多...
 
virtual bool StartSession (const TArray< FAnalyticsEventAttribute > &Attributes)=0
 Starts a session. 更多...
 

详细描述

Generic interface for an analytics provider.

Other modules can define more and register them with this module. See FAnalytics for details.

Easiest way to use this is like so:

// MakeAnalyticsEventAttributeArray is a convenient way to efficiently make an array of attributes // Since it returns an unnamed temporary, the compiler automatically selects the move-aware version. AnalyticsProvider->RecordEvent(TEXT("MyEvent"), MakeAnalyticsEventAttributeArray("Attr1", "Value1", ... )); or: TArray<FAnalyticEventAttribute> Attrs; Attrs.Add(...); AnalyticsProvider->RecordEvent(TEXT("MyEvent"), Attrs);

Several APIs build off the pure virtual ones. The following pure virtuals must be implemented by a derived class.

virtual bool StartSession(const TArray<FAnalyticsEventAttribute>& Attributes)
virtual void EndSession()
virtual FString GetSessionID() const
virtual bool SetSessionID(const FString& InSessionID)
virtual void FlushEvents()
virtual void SetUserID(const FString& InUserID)
virtual FString GetUserID() const

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

There are several other methods to record specific types of events. They were added for legacy reasons to support specific third party implementations. Derived classes generally do not have to worry about them.

成员函数说明

◆ EndSession()

virtual void IAnalyticsProvider::EndSession ( )
pure virtual

Ends the session.

Usually no need to call explicitly, as the provider should do this for you when the instance is destroyed.

◆ FlushEvents()

virtual void IAnalyticsProvider::FlushEvents ( )
pure virtual

Flush any cached events to the analytics provider.

Note that not all providers support explicitly sending any cached events. In which case this method does nothing.

◆ GetUserID()

virtual FString IAnalyticsProvider::GetUserID ( ) const
pure virtual

Gset the current UserID.

Use -ANALYTICSUSERID=<Name> command line to force the provider to use a specific UserID for this run.

◆ RecordCurrencyGiven() [1/2]

virtual void IAnalyticsProvider::RecordCurrencyGiven ( const FString &  GameCurrencyType,
int  GameCurrencyAmount 
)
inlinevirtual

Record a gift of in-game currency from the game itself.

Note that not all providers support currency events. In this case this method is equivalent to sending a regular event with name "Currency Given".

参数
GameCurrencyType- type of in game currency given, should be registered with the provider first.
GameCurrencyAmount- amount of in game currency given.

◆ RecordCurrencyGiven() [2/2]

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

Record a gift of in-game currency from the game itself.

Note that not all providers support currency events. In this case this method is equivalent to sending a regular event with name "Currency Given".

参数
GameCurrencyType- type of in game currency given, should be registered with the provider first.
GameCurrencyAmount- amount of in game currency given.
EventAttrs- a list of key/value pairs to assign to this event

◆ RecordCurrencyPurchase() [1/3]

virtual void IAnalyticsProvider::RecordCurrencyPurchase ( const FString &  GameCurrencyType,
int  GameCurrencyAmount 
)
inlinevirtual

Record an in-game purchase of a an item.

Note that not all providers support item purchase events. In this case this method is equivalent to sending a regular event with name "Item Purchase".

参数
ItemId- the ID of the item, should be registered with the provider first.
ItemQuantity- the number of Items purchased.

◆ RecordCurrencyPurchase() [2/3]

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

Record a purchase of in-game currency using real-world money.

Note that not all providers support currency events. In this case this method is equivalent to sending a regular event with name "Currency Purchase".

参数
GameCurrencyType- type of in game currency purchased, should be registered with the provider first.
GameCurrencyAmount- amount of in game currency purchased.
RealCurrencyType- real-world currency type (like a 3-character ISO 4217 currency code, but provider dependent).
RealMoneyCost- cost of the currency in real world money, expressed in RealCurrencyType units.
PaymentProvider- Provider who brokered the transaction. Generally arbitrary, but examples are PayPal, Facebook Credits, App Store, etc.

◆ RecordCurrencyPurchase() [3/3]

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

Record a purchase of in-game currency using real-world money.

Note that not all providers support currency events. In this case this method is equivalent to sending a regular event with name "Currency Purchase".

参数
GameCurrencyType- type of in game currency purchased, should be registered with the provider first.
GameCurrencyAmount- amount of in game currency purchased.
EventAttrs- a list of key/value pairs to assign to this event

◆ RecordError() [1/2]

virtual void IAnalyticsProvider::RecordError ( const FString &  Error)
inlinevirtual

Records an error that has happened in the game

Note that not all providers support all events. In this case this method is equivalent to sending a regular event with name "Game Error".

参数
Error- the error string to record

◆ RecordError() [2/2]

virtual void IAnalyticsProvider::RecordError ( const FString &  Error,
const TArray< FAnalyticsEventAttribute > &  EventAttrs 
)
inlinevirtual

Records an error that has happened in the game

Note that not all providers support all events. In this case this method is equivalent to sending a regular event with name "Game Error".

参数
Error- the error string to record
EventAttrs- a list of key/value pairs to assign to this event

◆ RecordEvent() [1/4]

void IAnalyticsProvider::RecordEvent ( const FString &  EventName)
inline

Overload for RecordEvent that takes no parameters

参数
EventNamename of the event

◆ RecordEvent() [2/4]

void IAnalyticsProvider::RecordEvent ( const FString &  EventName,
const FAnalyticsEventAttribute &  Attribute 
)
inline

Overload for RecordEvent that takes a single attribute

参数
EventNamename of the event
Attributeattribute name and value

◆ RecordEvent() [3/4]

void IAnalyticsProvider::RecordEvent ( const FString &  EventName,
const FString &  ParamName,
const FString &  ParamValue 
)
inline

Overload for RecordEvent that takes a single name/value pair

参数
EventNamename of the event
ParamNameattribute name
ParamValueattribute value

◆ RecordEvent() [4/4]

virtual void IAnalyticsProvider::RecordEvent ( const FString &  EventName,
const TArray< FAnalyticsEventAttribute > &  Attributes 
)
pure virtual

Records a named event with an array of attributes

参数
EventNamename of the event
Attributesarray of attribute name/value pairs

在 IAnalyticsProviderET , 以及 IAnalyticsProviderET 内被实现.

◆ RecordItemPurchase() [1/3]

virtual void IAnalyticsProvider::RecordItemPurchase ( const FString &  ItemId,
const FString &  Currency,
int  PerItemCost,
int  ItemQuantity 
)
inlinevirtual

Record an in-game purchase of a an item.

Note that not all providers support item purchase events. In this case this method is equivalent to sending a regular event with name "Item Purchase".

参数
ItemId- the ID of the item, should be registered with the provider first.
Currency- the currency of the purchase (ie, Gold, Coins, etc), should be registered with the provider first.
PerItemCost- the cost of one item in the currency given.
ItemQuantity- the number of Items purchased.

◆ RecordItemPurchase() [2/3]

void IAnalyticsProvider::RecordItemPurchase ( const FString &  ItemId,
int  ItemQuantity 
)
inline

Record an in-game purchase of a an item.

Note that not all providers support item purchase events. In this case this method is equivalent to sending a regular event with name "Item Purchase".

参数
ItemId- the ID of the item, should be registered with the provider first.
ItemQuantity- the number of Items purchased.

◆ RecordItemPurchase() [3/3]

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

Record an in-game purchase of a an item.

Note that not all providers support item purchase events. In this case this method is equivalent to sending a regular event with name "Item Purchase".

参数
ItemId- the ID of the item, should be registered with the provider first.
ItemQuantity- the number of Items purchased.
EventAttrs- a list of key/value pairs to assign to this event

◆ RecordProgress() [1/3]

virtual void IAnalyticsProvider::RecordProgress ( const FString &  ProgressType,
const FString &  ProgressHierarchy 
)
inlinevirtual

Record a player progression event that has happened in the game

Note that not all providers support all events. In this case this method is equivalent to sending a regular event with name "Progression".

参数
Error- the error string to record

◆ RecordProgress() [2/3]

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

Record a player progression event that has happened in the game

Note that not all providers support all events. In this case this method is equivalent to sending a regular event with name "Progression".

参数
Error- the error string to record

◆ RecordProgress() [3/3]

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

Record a player progression event that has happened in the game

Note that not all providers support all events. In this case this method is equivalent to sending a regular event with name "Progression".

参数
Error- the error string to record

◆ SetSessionID()

virtual bool IAnalyticsProvider::SetSessionID ( const FString &  InSessionID)
pure virtual

Sets the session ID of the analytics session.

This is not something you normally have to do, except for circumstances where you need to send events on behalf of another user (like a dedicated server sending events for the connected clients).

◆ SetUserID()

virtual void IAnalyticsProvider::SetUserID ( const FString &  InUserID)
pure virtual

Set the UserID for use with analytics.

Some providers require a unique ID to be provided when supplying events, and some providers create their own. If you are using a provider that requires you to supply the ID, use this method to set it.

◆ StartSession() [1/4]

bool IAnalyticsProvider::StartSession ( )
inline

Starts a session.

It's technically legal to send events without starting a session. The use case is for backends and dedicated servers to send events on behalf of a user without technically affecting the session length of the local player. Local players log in and start/end the session, but remote players simply call SetUserID and start sending events, which is legal and analytics providers should gracefully handle this. Repeated calls to this method will be ignored.

返回
true if the session started successfully.

◆ StartSession() [2/4]

bool IAnalyticsProvider::StartSession ( const FAnalyticsEventAttribute &  Attribute)
inline

Overload for StartSession that takes a single attribute

参数
Attributeattribute name and value

◆ StartSession() [3/4]

bool IAnalyticsProvider::StartSession ( const FString &  ParamName,
const FString &  ParamValue 
)
inline

Overload for StartSession that takes a single name/value pair

参数
ParamNameattribute name
ParamValueattribute value

◆ StartSession() [4/4]

virtual bool IAnalyticsProvider::StartSession ( const TArray< FAnalyticsEventAttribute > &  Attributes)
pure virtual

Starts a session.

See parameterless-version for contract details.

参数
Attributesattributes of the session. Arbitrary set of key/value pairs that will be sent with the StartSession event that this should also trigger.

在 IAnalyticsProviderET , 以及 IAnalyticsProviderET 内被实现.


该类的文档由以下文件生成: