UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAnalyticsEventAttribute Struct Reference

#include <AnalyticsEventAttribute.h>

Public Types

enum class  AttrTypeEnum {
  String , Number , Boolean , Null ,
  JsonFragment
}
 

Public Member Functions

template<typename ValueType >
 FAnalyticsEventAttribute (FString InName, ValueType &&InValue)
 
const FString & GetName () const
 
const FString & GetValue () const
 
bool IsJsonFragment () const
 
template<typename ValueType >
void SetValue (ValueType &&InValue)
 
 FAnalyticsEventAttribute ()
 
 ~FAnalyticsEventAttribute ()
 
 FAnalyticsEventAttribute (const FAnalyticsEventAttribute &RHS)
 
 FAnalyticsEventAttribute (FAnalyticsEventAttribute &&RHS)
 
FAnalyticsEventAttributeoperator= (const FAnalyticsEventAttribute &RHS)
 
FAnalyticsEventAttributeoperator= (FAnalyticsEventAttribute &&RHS)
 
FAnalyticsEventAttributeoperator+= (const FAnalyticsEventAttribute &RHS)
 
FAnalyticsEventAttributeoperator+ (const FAnalyticsEventAttribute &RHS)
 
FString ToString () const
 
void SwitchToJsonFragment ()
 

Static Public Member Functions

static bool IsValidAttributeName (const FString &InName)
 

Public Attributes

const FString AttrName
 
const FString AttrValueString
 
const double AttrValueNumber
 
const bool AttrValueBool
 
const AttrTypeEnum AttrType
 

Detailed Description

Struct to hold key/value pairs that will be sent as attributes along with analytics events. All values are actually strings, but we provide a convenient constructor that relies on ToStringForAnalytics() to convert common types.

Member Enumeration Documentation

◆ AttrTypeEnum

Enumerator
String 
Number 
Boolean 
Null 
JsonFragment 

Constructor & Destructor Documentation

◆ FAnalyticsEventAttribute() [1/4]

template<typename ValueType >
FAnalyticsEventAttribute::FAnalyticsEventAttribute ( FString  InName,
ValueType &&  InValue 
)
inline

◆ FAnalyticsEventAttribute() [2/4]

PRAGMA_DISABLE_DEPRECATION_WARNINGS FAnalyticsEventAttribute::FAnalyticsEventAttribute ( )
inline

Default ctor since we declare a custom ctor.

◆ ~FAnalyticsEventAttribute()

FAnalyticsEventAttribute::~FAnalyticsEventAttribute ( )
inlinedefault

◆ FAnalyticsEventAttribute() [3/4]

FAnalyticsEventAttribute::FAnalyticsEventAttribute ( const FAnalyticsEventAttribute RHS)
inlinedefault

Reinstate the default copy ctor because that one still works fine.

◆ FAnalyticsEventAttribute() [4/4]

FAnalyticsEventAttribute::FAnalyticsEventAttribute ( FAnalyticsEventAttribute &&  RHS)
inline

Hack to allow copy ctor using an rvalue-ref. This class only "sort of" acts like an immutable class because the const members prevents assignment, which was not intended when this code was changed.

Member Function Documentation

◆ GetName()

const FString & FAnalyticsEventAttribute::GetName ( ) const
inline

◆ GetValue()

const FString & FAnalyticsEventAttribute::GetValue ( ) const
inline

◆ IsJsonFragment()

bool FAnalyticsEventAttribute::IsJsonFragment ( ) const
inline

◆ IsValidAttributeName()

static bool FAnalyticsEventAttribute::IsValidAttributeName ( const FString &  InName)
inlinestatic

◆ operator+()

FAnalyticsEventAttribute & FAnalyticsEventAttribute::operator+ ( const FAnalyticsEventAttribute RHS)
inline

ALlow aggregation of attributes

◆ operator+=()

FAnalyticsEventAttribute & FAnalyticsEventAttribute::operator+= ( const FAnalyticsEventAttribute RHS)
inline

ALlow aggregation of attributes

◆ operator=() [1/2]

FAnalyticsEventAttribute & FAnalyticsEventAttribute::operator= ( const FAnalyticsEventAttribute RHS)
inline

Hack to allow assignment. This class only "sort of" acts like an immutable class because the const members prevents assignment, which was not intended when this code was changed.

◆ operator=() [2/2]

FAnalyticsEventAttribute & FAnalyticsEventAttribute::operator= ( FAnalyticsEventAttribute &&  RHS)
inline

Hack to allow assignment. This class only "sort of" acts like an immutable class because the const members prevents assignment, which was not intended when this code was changed.

◆ SetValue()

template<typename ValueType >
void FAnalyticsEventAttribute::SetValue ( ValueType &&  InValue)
inline

Allow setting value for any type that supports LexToString

◆ SwitchToJsonFragment()

void FAnalyticsEventAttribute::SwitchToJsonFragment ( )
inline

Legacy support for old RecordEventJson API. Don't call this directly.

◆ ToString()

FString FAnalyticsEventAttribute::ToString ( ) const
inline

If you need the old AttrValue behavior (i.e. stringify everything), call this function instead.

Member Data Documentation

◆ AttrName

const FString FAnalyticsEventAttribute::AttrName

◆ AttrType

const AttrTypeEnum FAnalyticsEventAttribute::AttrType

◆ AttrValueBool

const bool FAnalyticsEventAttribute::AttrValueBool

◆ AttrValueNumber

const double FAnalyticsEventAttribute::AttrValueNumber

◆ AttrValueString

const FString FAnalyticsEventAttribute::AttrValueString

The documentation for this struct was generated from the following file: