Our analytics tracking system allows you to track custom client-side events and properties to better understand your users’ behavior. Integration is simple and requires only a few lines of code.
#include "Core/TDKAnalyticsAPI.h"
bool TrackCustom(
FString EvtName,
TMap<FString, FString> EvtProps,
bool bHighPriority,
const FSendEventBatchDelegate& SuccessDelegate = FSendEventBatchDelegate(),
const FTDKErrorDelegate& ErrorDelegate = FTDKErrorDelegate(),
);
#include "TDKCpp.h"
#include "Core/TDKError.h"
#include "Core/TDKAnalyticsDataModels.h"
#include "Core/TDKAnalyticsAPI.h"
TDKAnalyticsPtr AnalyticsPtr = ITDKCppModuleInterface::Get().GetAnalyticsAPI();
TMap<FString, FString> EventProps;
EventProps.Add(TEXT("step"), TEXT("0"));
AnalyticsPtr->TrackCustom(
TEXT("ftue_started"),
EventProps,
true,
TDK::UTDKAnalyticsAPI::FSendEventBatchDelegate::CreateUObject(this, &ALogActor::OnSuccess),
TDK::FTDKErrorDelegate::CreateUObject(this, &ALogActor::OnError));
void ALogActor::OnSuccess(const TDK::AnalyticsModels::FSendEventResponse& Result) const
{
UE_LOG(LogTemp, Warning, TEXT("Congratulations, you made your first successful Analytics API call!"));
UE_LOG(LogTemp, Warning, TEXT("Request Id: %s"), *Result.RequestId);
UE_LOG(LogTemp, Warning, TEXT("MD5 Of Message Attributes: %s"), *Result.MD5OfMessageAttributes);
UE_LOG(LogTemp, Warning, TEXT("MD5 Of Message Body: %s"), *Result.MD5OfMessageBody);
UE_LOG(LogTemp, Warning, TEXT("MD5 Of Message System Attributes: %s"), *Result.MD5OfMessageSystemAttributes);
UE_LOG(LogTemp, Warning, TEXT("Message Id: %s"), *Result.MessageId);
UE_LOG(LogTemp, Warning, TEXT("Sequence Number: %s"), *Result.SequenceNumber);
}
void ALogActor::OnError(const TDK::FTDKCppError& ErrorResult) const
{
UE_LOG(LogTemp, Error, TEXT("Something went wrong with your first API call.\nHere's some debug information:\n%s"), *ErrorResult.GenerateErrorReport());
}