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

#include <Analytics.h>

+ Inheritance diagram for FAnalytics:

Classes

struct  ConfigFromIni
 

Public Member Functions

 FAnalytics ()
 
virtual ~FAnalytics ()
 
virtual TSharedPtr< IAnalyticsProviderCreateAnalyticsProvider (const FName &ProviderModuleName, const FAnalyticsProviderConfigurationDelegate &GetConfigValue)
 
virtual TSharedPtr< IAnalyticsTracerCreateAnalyticsTracer ()
 
virtual TSharedPtr< IAnalyticsProviderGetDefaultConfiguredProvider ()
 
virtual FString GetConfigValueFromIni (const FString &IniName, const FString &SectionName, const FString &KeyName, bool bIsRequired)
 
virtual void WriteConfigValueToIni (const FString &IniName, const FString &SectionName, const FString &KeyName, const FString &Value)
 
- Public Member Functions inherited from IModuleInterface
virtual ~IModuleInterface ()
 
virtual void PreUnloadCallback ()
 
virtual void PostLoadCallback ()
 
virtual bool SupportsDynamicReloading ()
 
virtual bool SupportsAutomaticShutdown ()
 
virtual bool IsGameModule () const
 

Static Public Member Functions

static FAnalyticsGet ()
 
static bool IsAvailable ()
 

Detailed Description

The public interface for interacting with analytics. The basic usage is to call CreateAnalyticsProvider and supply a configuration delegate. Specific analytics providers may choose to provide strongly-typed factory methods for configuration, in which case you are free to call that directly if you know exactly what provider you will be using. This class merely facilitates loosely bound provider configuration so the provider itself can be configured purely via config.

BuildType methods exist as a common way for an analytics provider to configure itself for debug/development/playtest/release scenarios. Again, you can choose to ignore this info and provide a generic configuration delegate that does anything it wants.

To create an analytics provider using all the system defaults, simply call the static GetDefaultConfiguredProvider().

Constructor & Destructor Documentation

◆ FAnalytics()

FAnalytics::FAnalytics ( )

◆ ~FAnalytics()

FAnalytics::~FAnalytics ( )
virtual

Member Function Documentation

◆ CreateAnalyticsProvider()

TSharedPtr< IAnalyticsProvider > FAnalytics::CreateAnalyticsProvider ( const FName ProviderModuleName,
const FAnalyticsProviderConfigurationDelegate GetConfigValue 
)
virtual

Factory function to create a specific analytics provider by providing the string name of the provider module, which will be dynamically loaded.

Parameters
ProviderModuleNameThe name of the module that contains the specific provider. It must be the primary module interface.
GetConfigvalueDelegate used to configure the provider. The provider will call this delegate once for each key it requires for configuration.
Returns
the analytics provider instance that was created. Could be NULL if initialization failed.

◆ CreateAnalyticsTracer()

TSharedPtr< IAnalyticsTracer > FAnalytics::CreateAnalyticsTracer ( )
virtual

◆ Get()

static FAnalytics & FAnalytics::Get ( )
inlinestatic

Singleton-like access to this module's interface. This is just for convenience! Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.

Returns
Returns singleton instance, loading the module on demand if needed

◆ GetConfigValueFromIni()

FString FAnalytics::GetConfigValueFromIni ( const FString &  IniName,
const FString &  SectionName,
const FString &  KeyName,
bool  bIsRequired 
)
virtual

Helper for reading configuration values from an INI file (which will be a common scenario). This is exposed here so we're not exporting more classes from the module. It's merely a helper for ConfigFromIni struct above.

◆ GetDefaultConfiguredProvider()

virtual TSharedPtr< IAnalyticsProvider > FAnalytics::GetDefaultConfiguredProvider ( )
inlinevirtual

Creates an instance of the default configured analytics provider. Default is determined by GetDefaultProviderModuleName and a default constructed ConfigFromIni instance.

This implementation is kept in the header file to illustrate how providers are created using configuration delegates.

◆ IsAvailable()

static bool FAnalytics::IsAvailable ( )
inlinestatic

Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.

Returns
True if the module is loaded and ready to use

◆ WriteConfigValueToIni()

void FAnalytics::WriteConfigValueToIni ( const FString &  IniName,
const FString &  SectionName,
const FString &  KeyName,
const FString &  Value 
)
virtual

Helper for writing configuration values from to an INI file (which will be a common scenario).


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