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.
|
pure virtual |
Ends the session.
Usually no need to call explicitly, as the provider should do this for you when the instance is destroyed.
|
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.
|
pure virtual |
Gset the current UserID.
Use -ANALYTICSUSERID=<Name> command line to force the provider to use a specific UserID for this run.
|
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. |
|
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 |
|
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. |
|
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. |
|
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 |
|
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 |
|
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 |
|
inline |
Overload for RecordEvent that takes no parameters
| EventName | name of the event |
|
inline |
Overload for RecordEvent that takes a single attribute
| EventName | name of the event |
| Attribute | attribute name and value |
|
inline |
Overload for RecordEvent that takes a single name/value pair
| EventName | name of the event |
| ParamName | attribute name |
| ParamValue | attribute value |
|
pure virtual |
Records a named event with an array of attributes
| EventName | name of the event |
| Attributes | array of attribute name/value pairs |
在 IAnalyticsProviderET , 以及 IAnalyticsProviderET 内被实现.
|
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. |
|
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. |
|
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 |
|
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 |
|
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 |
|
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 |
|
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).
|
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.
|
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.
|
inline |
Overload for StartSession that takes a single attribute
| Attribute | attribute name and value |
|
inline |
Overload for StartSession that takes a single name/value pair
| ParamName | attribute name |
| ParamValue | attribute value |
|
pure virtual |
Starts a session.
See parameterless-version for contract details.
| Attributes | attributes of the session. Arbitrary set of key/value pairs that will be sent with the StartSession event that this should also trigger. |
在 IAnalyticsProviderET , 以及 IAnalyticsProviderET 内被实现.