UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAnalyticsProviderLog Class Reference

#include <AnalyticsProviderLog.h>

+ Inheritance diagram for FAnalyticsProviderLog:

Public Member Functions

 FAnalyticsProviderLog (const FAnalyticsProviderConfigurationDelegate &GetConfigValue)
 
 ~FAnalyticsProviderLog ()
 
virtual bool StartSession (const TArray< FAnalyticsEventAttribute > &Attributes={}) override
 
virtual void EndSession () override
 
virtual void FlushEvents () override
 
virtual void SetDefaultEventAttributes (TArray< FAnalyticsEventAttribute > &&Attributes) override
 
virtual TArray< FAnalyticsEventAttributeGetDefaultEventAttributesSafe () const override
 
virtual int32 GetDefaultEventAttributeCount () const override
 
virtual FAnalyticsEventAttribute GetDefaultEventAttribute (int AttributeIndex) const override
 
virtual bool SetSessionID (const FString &InSessionID) override
 
virtual void SetUserID (const FString &InUserID) override
 
virtual FString GetSessionID () const override
 
virtual FString GetUserID () const override
 
virtual void RecordEvent (const FString &EventName, const TArray< FAnalyticsEventAttribute > &Attributes={}) override
 
- Public Member Functions inherited from IAnalyticsProvider
bool StartSession ()
 
bool StartSession (const FAnalyticsEventAttribute &Attribute)
 
bool StartSession (const FString &ParamName, const FString &ParamValue)
 
virtual void SetBuildInfo (const FString &InBuildInfo)
 
virtual void SetGender (const FString &InGender)
 
virtual void SetLocation (const FString &InLocation)
 
virtual void SetAge (const int32 InAge)
 
virtual void RecordEvent (const FString &EventName, const TArray< FAnalyticsEventAttribute > &Attributes, EAnalyticsRecordEventMode Mode)
 
void RecordEvent (const FString &EventName)
 
void RecordEvent (const FString &EventName, const FAnalyticsEventAttribute &Attribute)
 
void RecordEvent (const FString &EventName, const FString &ParamName, const FString &ParamValue)
 
virtual void RecordItemPurchase (const FString &ItemId, const FString &Currency, int PerItemCost, int ItemQuantity)
 
virtual void RecordItemPurchase (const FString &ItemId, int ItemQuantity, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 
void RecordItemPurchase (const FString &ItemId, int ItemQuantity)
 
virtual void RecordCurrencyPurchase (const FString &GameCurrencyType, int GameCurrencyAmount, const FString &RealCurrencyType, float RealMoneyCost, const FString &PaymentProvider)
 
virtual void RecordCurrencyPurchase (const FString &GameCurrencyType, int GameCurrencyAmount, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 
virtual void RecordCurrencyPurchase (const FString &GameCurrencyType, int GameCurrencyAmount)
 
virtual void RecordCurrencyGiven (const FString &GameCurrencyType, int GameCurrencyAmount)
 
virtual void RecordCurrencyGiven (const FString &GameCurrencyType, int GameCurrencyAmount, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 
virtual void RecordError (const FString &Error, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 
virtual void RecordError (const FString &Error)
 
virtual void RecordProgress (const FString &ProgressType, const TArray< FString > &ProgressHierarchy, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 
virtual void RecordProgress (const FString &ProgressType, const FString &ProgressHierarchy)
 
virtual void RecordProgress (const FString &ProgressType, const FString &ProgressHierarchy, const TArray< FAnalyticsEventAttribute > &EventAttrs)
 
virtual ~IAnalyticsProvider ()
 

Detailed Description

Implementation of the IAnalyticsProviderET interface that exports telemetry events to a file as Newline - delimited JSON By default,the log file is written to Saved/Telemetry folder of the application. FileName and FolderPath can be overridden in the configuration Here as a simple example of how a developer might implement and configure their own analytics provider for use with the StudioTelemerty plugin

Constructor & Destructor Documentation

◆ FAnalyticsProviderLog()

FAnalyticsProviderLog::FAnalyticsProviderLog ( const FAnalyticsProviderConfigurationDelegate GetConfigValue)

◆ ~FAnalyticsProviderLog()

FAnalyticsProviderLog::~FAnalyticsProviderLog ( )

Member Function Documentation

◆ EndSession()

void FAnalyticsProviderLog::EndSession ( )
overridevirtual

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

Implements IAnalyticsProvider.

◆ FlushEvents()

void FAnalyticsProviderLog::FlushEvents ( )
overridevirtual

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.

Implements IAnalyticsProvider.

◆ GetDefaultEventAttribute()

FAnalyticsEventAttribute FAnalyticsProviderLog::GetDefaultEventAttribute ( int  AttributeIndex) const
overridevirtual

Used with GetDefaultEventAttributeCount to iterate over the default attributes.

Range checking is not done, similar to TArray. Use GetDefaultAttributeCount() first!

Returns
one attribute of the default attributes so we don't have to copy the entire attribute array.

Implements IAnalyticsProvider.

◆ GetDefaultEventAttributeCount()

int32 FAnalyticsProviderLog::GetDefaultEventAttributeCount ( ) const
overridevirtual

Used with GetDefaultAttribute to iterate over the default attributes.

Returns
the number of default attributes are currently being applied.

Implements IAnalyticsProvider.

◆ GetDefaultEventAttributesSafe()

TArray< FAnalyticsEventAttribute > FAnalyticsProviderLog::GetDefaultEventAttributesSafe ( ) const
overridevirtual
Returns
the current array of default attributes.

Implements IAnalyticsProvider.

◆ GetSessionID()

FString FAnalyticsProviderLog::GetSessionID ( ) const
overridevirtual

Gets the opaque session identifier string for the provider.

Implements IAnalyticsProvider.

◆ GetUserID()

FString FAnalyticsProviderLog::GetUserID ( ) const
overridevirtual

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

Implements IAnalyticsProvider.

◆ RecordEvent()

void FAnalyticsProviderLog::RecordEvent ( const FString &  EventName,
const TArray< FAnalyticsEventAttribute > &  Attributes = {} 
)
overridevirtual

Records a named event with an array of attributes

Parameters
EventNamename of the event
Attributesarray of attribute name/value pairs

Implements IAnalyticsProvider.

◆ SetDefaultEventAttributes()

void FAnalyticsProviderLog::SetDefaultEventAttributes ( TArray< FAnalyticsEventAttribute > &&  Attributes)
overridevirtual

Sets an array of attributes that will automatically be appended to any event that is sent. Logical effect is like adding them to all events before calling RecordEvent. Practically, it is implemented much more efficiently from a storage and allocation perspective.

Implements IAnalyticsProvider.

◆ SetSessionID()

bool FAnalyticsProviderLog::SetSessionID ( const FString &  InSessionID)
overridevirtual

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).

Implements IAnalyticsProvider.

◆ SetUserID()

void FAnalyticsProviderLog::SetUserID ( const FString &  InUserID)
overridevirtual

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.

Implements IAnalyticsProvider.

◆ StartSession()

bool FAnalyticsProviderLog::StartSession ( const TArray< FAnalyticsEventAttribute > &  Attributes = {})
overridevirtual

Starts a session. See parameterless-version for contract details.

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

Implements IAnalyticsProvider.


The documentation for this class was generated from the following files: