Unreal Engine
Plugin installation
Unzip the DTDAnalytics.zip archive to the Plugins folder of your project.
For a C++ project type, add the DTDAnalytics name to the list of dependency module names to the <module_name>.Build.cs file of the module in which you plan to use the plugin.
Example:
PublicDependencyModuleNames.Add("DTDAnalytics");Data types
class UDTDAnalyticsLibrary
A class that implements analytic methods.
Header file:
#include "DTDAnalytics/Public/DTDAnalyticsBPLibrary.h"class UDTDUserCardLibrary
A class that implements user card methods.
The class header:
#include "DTDAnalytics/Public/DTDUserCardBPLibrary.h"enum class EDTDTrackingStatus : uint8
SDK tracking status.
Header file:
#include "DTDAnalytics/Public/DTDTrackingStatus.h"Values:
Unknown = 0- leave tracking unchangedEnable = 1- tracking enabledDisable = 2- tracking disabled
Example:
EDTDTrackingStatus TrackingStatus = EDTDTrackingStatus::Enable;enum class EDTDLogLevel : uint8
SDK logging level.
Header file:
#include "DTDAnalytics/Public/DTDLogLevel.h"Values:
Unknown = 0- leave logging level unchangedNo = 1- logging disabledError = 2- logging of errorsWarning = 3- logging of warnings and errorsInfo = 4- logging of information messages, warnings and errorsDebug = 5- logging of debugging messages, informational messages, warnings and errors
Example:
EDTDLogLevel LogLevel = EDTDLogLevel::Info;enum class EDTDAccrualType : uint8
Types of resource accumulation.
Header file:
#include "DTDAnalytics/Public/DTDAccrualType.h"Values:
Earned = 0- earned resourcesBought = 1- purchased resources
Example:
EDTDAccrualType AccrualType = EDTDAccrualType::Earned;enum class EDTDSocialNetwork : uint8
Predefined social media.
Header file:
#include "DTDAnalytics/Public/DTDSocialNetwork.h"Values:
Facebook = 0Vkontakte = 1Twitter = 2Googleplus = 3Whatsapp = 4Viber = 5Evernote = 6Googlemail = 7Linkedin = 8Pinterest = 9Reddit = 10Renren = 11Tumblr = 12Qzone = 13
Example:
EDTDSocialNetwork SocialNetwork = EDTDSocialNetwork::Facebook;enum class EDTDGender: uint8
User gender.
Header file:
#include "DTDAnalytics/Public/DTDGender.h"Values:
Unknown = 0Male = 1Female = 2
Example:
EDTDGender Gender = EDTDGender::Female;enum class EDTDReferralProperty : uint8
Referral properties.
Header file:
#include "DTDAnalytics/Public/DTDReferralProperty.h"Values:
Source = 0Medium = 1Content = 2Campaign = 3Term = 4
Example:
EDTDReferralProperty ReferralProperty = EDTDReferralProperty::Source;struct FDTDOptionalInt32
An optional parameter of int32 type
Header file:
#include "DTDAnalytics/Public/DTDOptionalInt32.h"HasValue
bool
Option label
Value
int32
Parameter value
For your convenience, we implemented the conversion constructor:
FDTDOptionalInt32(int32 value) : HasValue(true), Value(value) {}Example:
FDTDOptionalInt32 OptionalParameter = 1;struct FDTDOptionalString
An optional parameter of FString type.
Header file:
#include "DTDAnalytics/Public/DTDOptionalString.hHasValue
bool
Option label
Value
FString
Parameter value
For your convenience, we implemented the conversion constructor:
FDTDOptionalString(FString value) : HasValue(true), Value(value) {}Example:
FDTDOptionalString OptionalParameter = FString("StringValue");struct FDTDAnalyticsConfiguration
Configuration of the analytics plugin.
Header file:
#include "DTDAnalytics/Public/DTDAnalyticsConfiguration.h"LogLevel
EDTDLogLevel
Logging level
CurrentLevel
FDTDOptionalInt32
Current level
UserId
FDTDOptionalString
User ID
ApplicationVersion
FDTDOptionalString
Application version (Windows)
TrackingAvailability
EDTDTrackingStatus
Tracking settings
Example:
FDTDAnalyticsConfiguration config;
config.LogLevel = EDTDLogLevel::Debug;
config.CurrentLevel = 3;
config.UserId = FString("CUID");
config.ApplicationVersion = FString("1.2.3");
config.TrackingAvailability = EDTDTrackingStatus::Enable;FDTDCustomEventParams
Custom parameters of a custom event.
Header file:
#include "DTDAnalytics/Public/DTDCustomEventParams.h"StringParameters
TMap<FString, FString>
String parameters
IntParameters
TMap<FString, int64>
Integer parameters
FloatParameters
TMap<FString, float>
Real parameters (floating-point numbers)
BoolParameters
TMap<FString, bool>
Boolean parameters
Example:
FDTDCustomEventParams params;
params.BoolParameters.Add("BoolKey", true);
params.FloatParameters.Add("FloatKey", 3.3);
params.IntParameters.Add("IntKey");
params.StringParameters.Add("StringKey", "StringValue");struct FDTDStartProgressionEventParams
Parameters of the progression start event.
Header file:
#include "DTDAnalytics/Public/DTDStartProgressionEventParams.h"Difficulty
FDTDOptionalInt32
Difficulty
Source
FDTDOptionalString
Source
Example:
FDTDStartProgressionEventParams params;
params.Difficulty = 3;
params.Source = FString("Source");struct FDTDFinishProgressionEventParams
Parameters of the progression completion event.
Header file:
#include "DTDAnalytics/Public/DTDFinishProgressionEventParams.h"SuccessfulCompletion
bool
Successful completion of the progression (‘false’ by default)
Duration
int32
Duration (if 0, duration is calculated automatically)
Spent
TMap<FString, int64>
Resources spent
Earned
TMap<FString, int64>
Resources earned
Example:
FDTDFinishProgressionEventParams params;
params.Duration = 200;
params.SuccessfulCompletion = true;
params.Earned.Add("CurrencyName1", 1);
params.Spent.Add("CurrencyName2", 2);Delegates
Header file:
#include "DTDAnalytics/Public/DTDDelegates.h"Definitions:
DECLARE_DELEGATE_OneParam(FDTDLongListenerDelegate, int64);
DECLARE_DELEGATE_OneParam(FDTDGetterStringDelegate, const FString&);
DECLARE_DELEGATE_OneParam(FDTDGetterBoolDelegate, bool);
DECLARE_DELEGATE_OneParam(FDTDGetterIntDelegate, int32);
DECLARE_DELEGATE_OneParam(FDTDGetterLongDelegate, int64);
DECLARE_DELEGATE_OneParam(FDTDGetterGenderDelegate, EDTDGender);
DECLARE_DELEGATE_TwoParams(FDTDGetterOptionalStringDelegate, bool, const FString&);
DECLARE_DELEGATE_TwoParams(FDTDGetterOptionalBoolDelegate, bool, bool);
DECLARE_DELEGATE_TwoParams(FDTDGetterOptionalFloatDelegate, bool, float);
DECLARE_DELEGATE_TwoParams(FDTDGetterOptionalLongDelegate, bool, int64);
DECLARE_DELEGATE_ThreeParams(FDTDGetterOptionalStringWithKeyDelegate, bool, const FString&, const FString&);
DECLARE_DELEGATE_ThreeParams(FDTDGetterOptionalBoolWithKeyDelegate, bool, const FString&, bool);
DECLARE_DELEGATE_ThreeParams(FDTDGetterOptionalFloatWithKeyDelegate, bool, const FString&, float);
DECLARE_DELEGATE_ThreeParams(FDTDGetterOptionalLongWithKeyDelegate, bool, const FString&, int64);SDK initialization
SDK initialization without parameters:

appKey
FString
You can find it in the settings of the corresponding application in devtodev (Settings → SDK → Integration → Credentials)
UDTDAnalyticsBPLibrary::Initialize("AppKey");SDK initialization with parameters:

appKey
FString
You can find it in the settings of the corresponding application in devtodev (Settings → SDK → Integration → Credentials)
config
FDTDAnalyticsConfiguration
Initialization parameters
FDTDAnalyticsConfiguration config;
config.LogLevel = EDTDLogLevel::Debug;
config.CurrentLevel = 3;
config.UserId = FString("CUID");
config.ApplicationVersion = FString("1.2.3");
config.TrackingAvailability = EDTDTrackingStatus::Enable;
UDTDAnalyticsBPLibrary::InitializeWithConfig("AppKey", config);Last updated
Was this helpful?
