Navigation
API > API/Runtime > API/Runtime/Analytics
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
Several APIs build off the pure virtual ones. The following pure virtuals must be implemented by a derived class. virtual bool StartSession(const TArray
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.
| Name | IAnalyticsProvider |
| Type | class |
| Header File | /Engine/Source/Runtime/Analytics/Analytics/Public/Interfaces/IAnalyticsProvider.h |
| Include Path | #include "Interfaces/IAnalyticsProvider.h" |
Syntax
class IAnalyticsProvider
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IAnalyticsProvider() |
Interfaces/IAnalyticsProvider.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void EndSession () |
Ends the session. | Interfaces/IAnalyticsProvider.h | |
void FlushEvents () |
Flush any cached events to the analytics provider. | Interfaces/IAnalyticsProvider.h | |
FAnalyticsEventAttribute GetDefaultEventAttribute
(
int AttributeIndex |
Used with GetDefaultEventAttributeCount to iterate over the default attributes. | Interfaces/IAnalyticsProvider.h | |
int32 GetDefaultEventAttributeCount() |
Used with GetDefaultAttribute to iterate over the default attributes. | Interfaces/IAnalyticsProvider.h | |
TArray< FAnalyticsEventAttribute > GetDefaultEventAttributesSafe() |
Interfaces/IAnalyticsProvider.h | ||
FString GetSessionID() |
Gets the opaque session identifier string for the provider. | Interfaces/IAnalyticsProvider.h | |
FString GetUserID () |
Gset the current UserID. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordCurrencyGiven
(
const FString& GameCurrencyType, |
Record a gift of in-game currency from the game itself. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordCurrencyGiven
(
const FString& GameCurrencyType, |
Record a gift of in-game currency from the game itself. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordCurrencyPurchase
(
const FString& GameCurrencyType, |
Record a purchase of in-game currency using real-world money. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordCurrencyPurchase
(
const FString& GameCurrencyType, |
Record a purchase of in-game currency using real-world money. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordCurrencyPurchase
(
const FString& GameCurrencyType, |
Record an in-game purchase of a an item. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordError
(
const FString& Error, |
Records an error that has happened in the game | Interfaces/IAnalyticsProvider.h | |
virtual void RecordError
(
const FString& Error |
Records an error that has happened in the game | Interfaces/IAnalyticsProvider.h | |
void RecordEvent
(
const FString& EventName, |
Overload for RecordEvent that takes a single name/value pair | Interfaces/IAnalyticsProvider.h | |
void RecordEvent
(
const FString& EventName, |
Records a named event with an array of attributes | Interfaces/IAnalyticsProvider.h | |
void RecordEvent
(
const FString& EventName |
Overload for RecordEvent that takes no parameters | Interfaces/IAnalyticsProvider.h | |
void RecordEvent
(
const FString& EventName, |
Overload for RecordEvent that takes a single attribute | Interfaces/IAnalyticsProvider.h | |
virtual void RecordItemPurchase
(
const FString& ItemId, |
Record an in-game purchase of a an item. | Interfaces/IAnalyticsProvider.h | |
void RecordItemPurchase
(
const FString& ItemId, |
Record an in-game purchase of a an item. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordItemPurchase
(
const FString& ItemId, |
Record an in-game purchase of a an item. | Interfaces/IAnalyticsProvider.h | |
virtual void RecordProgress
(
const FString& ProgressType, |
Record a player progression event that has happened in the game | Interfaces/IAnalyticsProvider.h | |
virtual void RecordProgress
(
const FString& ProgressType, |
Record a player progression event that has happened in the game | Interfaces/IAnalyticsProvider.h | |
virtual void RecordProgress
(
const FString& ProgressType, |
Record a player progression event that has happened in the game | Interfaces/IAnalyticsProvider.h | |
virtual void SetAge
(
const int32 InAge |
Sets the location the game believes the user is playing in as part of the session | Interfaces/IAnalyticsProvider.h | |
virtual void SetBuildInfo
(
const FString& InBuildInfo |
Sets a user defined string as the build information/version for the session | Interfaces/IAnalyticsProvider.h | |
void SetDefaultEventAttributes
(
TArray< FAnalyticsEventAttribute >&& Attributes |
Sets an array of attributes that will automatically be appended to any event that is sent. | Interfaces/IAnalyticsProvider.h | |
virtual void SetGender
(
const FString& InGender |
Sets the gender the game believes the user is as part of the session | Interfaces/IAnalyticsProvider.h | |
virtual void SetLocation
(
const FString& InLocation |
Sets the location the game believes the user is playing in as part of the session | Interfaces/IAnalyticsProvider.h | |
bool SetSessionID
(
const FString& InSessionID |
Sets the session ID of the analytics session. | Interfaces/IAnalyticsProvider.h | |
void SetUserID
(
const FString& InUserID |
Set the UserID for use with analytics. | Interfaces/IAnalyticsProvider.h | |
bool StartSession () |
Starts a session. | Interfaces/IAnalyticsProvider.h | |
bool StartSession
(
const TArray< FAnalyticsEventAttribute >& Attributes |
Starts a session. See parameterless-version for contract details. | Interfaces/IAnalyticsProvider.h | |
bool StartSession
(
const FAnalyticsEventAttribute& Attribute |
Overload for StartSession that takes a single attribute | Interfaces/IAnalyticsProvider.h | |
bool StartSession
(
const FString& ParamName, |
Overload for StartSession that takes a single name/value pair | Interfaces/IAnalyticsProvider.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CheckForDuplicateAttributes
(
const FString& EventName, |
Checks for duplicate key names in the attribute array. | Interfaces/IAnalyticsProvider.h |