The SDK is available as an AAR (recommended) and JAR library. The library is available in the MavenCentral and GitHub repository.
Attention!
From the SDK version com.devtodev:android-analytics:'2.2.3'
and above you need to add com.devtodev:android-google:'1.0.0'.
This framework encapsulates work with Google ads ID. When developing and publishing apps for kids COPPA, you don’t need com.devtodev:android-google
. You can find more information about working with COPPA at the end of this guide.
In the Project build.gradle
file, declare the mavenCentral
repository:
If you use Gradle for building apps specify the following dependencies in the application build.gradle
file.
Working with Advertising ID with Android API level less than 26
If you plan to use com.google.android.gms:play-services-ads-identifier:18.2.0
and above, you need to add com.android.tools:desugar_jdk_libs
to maintain backward compatibility with devices with API level less than 26, see Use Java 8 language features and APIs | Android Studio | Android Developers
We also recommend AGP 8.0+ as it makes it easier to configure com.android.tools:desugar_jdk_libs
If you use Gradle for compiling apps, declare the following dependencies in the build.gradle file in the dependency block:
In the Project build.gradle
file declare the agconnect plugin
In the application build.gradle file declare the following dependencies:
And add a plugin:
For more information see huawei official documents.
The com.devtodev.android-huawei
framework works with OAID and ODID IDs. In case the OAID is undefined, we use the ODID. For both IDs to work correctly, take the following steps:
Create a project and an app in AppGallery. Open AppGalleryConnect → Project Settings.
Sign your app using a certificate (see here).
Enter SHA-256 certificate in the App information section. Read more about certificate creation here.
After taking all the steps described above, open the ‘App information’ section and download agconnect-services.json. You need to place this file in the app folder (read more).
Use the following way to initialize the library in the first Activity onCreate()
method:
You can find the App ID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
- is a DTDAnalyticsConfiguration
object instance that is used for specifying additional properties during initialization.
DTDAnalyticsConfiguration
Parameter
Type
Description
currentLevel
Integer
The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.
userId
String
A custom user ID assigned by the developer. In the case of default calculation by device IDs, the identifier can be used for searching users in devtodev. In case the project uses calculation by user IDs, the parameter is mandatory because it becomes the principal calculation ID in devtodev.
trackingAvailability
DTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.enable
. SDK stores the previously assigned value. Pass DTDTrackingStatus.disable
if the user opted out of tracking in line with GDPR.
logLevel
DTDLogLevel (enum)
The level of logging the SDK activity. The DTDLogLevel.no
value is used by default. For troubleshooting during integration it is recommended to set it to DTDLogLevel.debug
, and either switch it off DTDLogLevel.no
. Use DTDLogLevel.no
in the release version.
Example:
Add the following strings to the proguard-rules.pro
file of your app
When developing and publishing apps targeted at children under 13 years old, you need to ensure special conditions for data processing. Any mobile app aimed at children or intended for users in a region with strict regulations on child online protection, must comply with current laws.
If your app has to comply with the legal requirements (COPPA), use the following recommendations:
Implement the coppaControlEnable
method. The method disables collection of ad IDs and vendor IDs.
If your app is using Google services, remove the following dependencies from gradle:
If your app is using Huawei services, remove the following dependencies from gradle:
Call the coppaControlEnable
method before SDK initialization. If the method was not called, the SDK will work as before.
CocoaPods is the easiest way to add devtodev into your iOS project.
1. Firstly, install CocoaPods using:
2. In the project directory execute the command:
3. In the created Podfile add the dependency:
4. Finally, run the command in your Xcode project directory:
CocoaPods should download and install the devtodev library, and create a new Xcode workspace. Open this workspace in Xcode.
1. Download the latest version of devtodev SDK from the repository
2. Add DTDAnalytics.xcframework
to the project
3. Add frameworks:
AppTrackingTransparency.framework
AdSupport.framework
4. Add initialization todidFinishLaunchingWithOptions
method:
An App ID can be found in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
- an object instance of DTDAnalyticsConfiguration
, which is used for specifying additional properties during the initialization.
DTDAnalyticsConfiguration
Parameter
Type
Description
currentLevel
int
The player level at the moment of devtodev SDK initialization. It is recommended (but optional) to use to improve data precision.
userId
string
A custom user identifier provided by the developer. If you utilize the default calculation by the device ID, this identifier can be used for finding a user in devtodev.
In case your project utilizes the calculation by the user identifier, you must set this parameter because it becomes the main user identifier in devtodev.
trackingAvailability
DTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.enable
. SDK stores the previously assigned value. Pass DTDTrackingStatus.disable
if the user opted out of tracking in line with GDPR.
logLevel
DTDLogLevel (enum)
The level of logging the SDK activity. The DTDLogLevel.no
value is used by default. For troubleshooting during integration it is recommended to set it to DTDLogLevel.debug
, and either switch it off DTDLogLevel.no
. Use DTDLogLevel.no
in the release version.
Example:
Create Bridging-Header. To do this, you need to add any swift file to the project (don’t delete it later) and choose ‘Create Bridging Header’ in the offered dialog box.
Make sure that the ‘Build Settings’ for ‘Defines Module’ value evaluates to ‘YES’.
While importing, use: #import <DTDAnalytics/DTDAnalytics-Swift.h>
For SDK to function properly, it needs to be integrated at the earliest moment of the app launch. It is recommended that you use the following method of main entry point initialization:
When developing and publishing apps targeted at children under 13 years old, you need to ensure special conditions for data processing. Any mobile app aimed at children or intended for users in a region with strict regulations on child online protection, must comply with current laws.
If your app has to comply with the legal requirements (COPPA), use the following recommendations:
Implement the coppaControlEnable
method. The method disables collection of ad IDs and vendor IDs (IDFA, IDFV).
To comply with Apple’s guidelines
Remove AppTrackingTransparency.framework
and all the links pointing to it.
Remove AdSupport.framework
all the links pointing to it.
Call the coppaControlEnable
method before SDK initialization. If the method was not called, the SDK will work as before.
The Privacy Manifest is a new way introduced at WWDC23 for third-party SDK developers to provide information about their privacy policies.
The Privacy Manifest describes the methods for ensuring code confidentiality in the application in a unified format. When publishing the application, Xcode will combine the privacy manifests of all third-party SDKs used in your application into a single, convenient report. This report makes it easier to create more accurate privacy labels (Nutrition Labels).
The Privacy Manifest includes the following sections for data entry:
Privacy Tracking Enabled
Privacy Tracking Domains
Privacy Nutrition Label Types
Privacy Accessed API Types
Privacy Tracking Enabled. A Boolean value indicating whether the application or third-party SDK uses data for tracking, as defined within the App Tracking Transparency framework.
Privacy Tracking Domains. An array of strings listing the internet domains that the application or third-party SDK connects to and participates in tracking.
Privacy Nutrition Label Types. An array of dictionaries describing the types of data collected by the application or third-party SDK. Nutrition Labels are needed to let users know what data the application collects before installing it from the App Store.
Privacy Accessed API Types. An array of dictionaries describing the types of APIs accessed by the application or third-party SDK, which are marked as APIs and require verification for access.
Privacy Nutrition Label Types
Product Interaction
No
No
Analytics
Device ID
No
No
Analytics
User ID
No
No
Analytics
Purchase History
No
No
Analytics
Other Data Types
No
No
Analytics
Privacy Accessed API Types
User Defaults
CA92.1: Access info from same app, per documentation
Privacy Nutrition Label Types
Device ID
No
No
Analytics
Other Data Types
No
No
Analytics
Privacy Accessed API Types
User Defaults
CA92.1: Access info from same app, per documentation
Since we distribute our SDKs as binary dependencies, we have implemented a signing practice. Now, when you use a new version of the SDK, Xcode will confirm that it has been signed by us, increasing the integrity of the software supply chain.
1. Download the latest version of devtodev SDK from the repository
2. Add DTDAnalytics.xcframework
to the project (with Do Not Embed specified)
3. Add frameworks:
AppTrackingTransparency.framework
AdSupport.framework
4. Add initialization todidFinishLaunchingWithOptions
method:
An App ID can be found in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
- an object instance of DTDAnalyticsConfiguration
, which is used for specifying additional properties during the initialization.
DTDAnalyticsConfiguration
Parameter
Type
Description
currentLevel
int
The player level at the moment of devtodev SDK initialization. It is recommended (but optional) to use to improve data precision.
userId
string
A custom user identifier provided by the developer. If you utilize the default calculation by the device ID, this identifier can be used for finding a user in devtodev.
In case your project utilizes the calculation by the user identifier, you must set this parameter because it becomes the main user identifier in devtodev.
trackingAvailability
DTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.enable
. SDK stores the previously assigned value. Pass DTDTrackingStatus.disable
if the user opted out of tracking in line with GDPR.
logLevel
DTDLogLevel (enum)
The level of logging the SDK activity. The DTDLogLevel.no
value is used by default. For troubleshooting during integration it is recommended to set it to DTDLogLevel.debug
, and either switch it off DTDLogLevel.no
. Use DTDLogLevel.no
in the release version.
Example:
Create Bridging-Header. To do this, you need to add any swift file to the project (don’t delete it later) and choose ‘Create Bridging Header’ in the offered dialog box.
Make sure that the ‘Build Settings’ for ‘Defines Module’ value evaluates to ‘YES’.
While importing, use: #import <DTDAnalytics/DTDAnalytics-Swift.h>
For SDK to function properly, it needs to be integrated at the earliest moment of the app launch. It is recommended that you use the following method of main entry point initialization:
When developing and publishing apps targeted at children under 13 years old, you need to ensure special conditions for data processing. Any mobile app aimed at children or intended for users in a region with strict regulations on child online protection, must comply with current laws.
If your app has to comply with the legal requirements (COPPA), use the following recommendations:
Implement the coppaControlEnable
method. The method disables collection of ad IDs and vendor IDs (IDFA, IDFV).
To comply with Apple’s guidelines
Remove AppTrackingTransparency.framework
and all the links pointing to it.
Remove AdSupport.framework
all the links pointing to it.
Call the coppaControlEnable
method before SDK initialization. If the method was not called, the SDK will work as before.
Find the DevToDev.Analytics.Uwp
package using the package manager search engine and click Install. The latest version of the package is recommended.
Initialize the library using the following code:
You can find the App ID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
- is a DTDAnalyticsConfiguration
object instance that is used for specifying additional properties during initialization.
DTDAnalyticsConfiguration
Parameter
Type
Description
currentLevel
Integer
The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.
userId
String
A custom user ID assigned by the developer. In the case of default calculation by device IDs, the identifier can be used for searching users in devtodev. In case the project uses calculation by user IDs, the parameter is mandatory because it becomes the principal calculation ID in devtodev.
trackingAvailability
DTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.Enable
. SDK stores the previously assigned value. Pass DTDTrackingStatus.Disable
if the user opted out of tracking in line with GDPR.
logLevel
DTDLogLevel (enum)
The level of logging the SDK activity. The DTDLogLevel.no
value is used by default. For troubleshooting during integration it is recommended to set it to DTDLogLevel.Debug
, and either switch it off DTDLogLevel.No
. Use DTDLogLevel.No
in the release version.
Example:
Find the DevToDev.Analytics
package using the package manager search engine and click Install. The latest version of the package is recommended.
Initialize the library using the following code:
You can find the App ID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
- is a DTDAnalyticsConfiguration
object instance that is used for specifying additional properties during initialization.
DTDAnalyticsConfiguration
Parameter
Type
Description
currentLevel
Integer
The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.
userId
String
A custom user ID assigned by the developer. In the case of default calculation by device IDs, the identifier can be used for searching users in devtodev. In case the project uses calculation by user IDs, the parameter is mandatory because it becomes the principal calculation ID in devtodev.
trackingAvailability
DTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.Enabl
e
. SDK stores the previously assigned value. Pass DTDTrackingStatus.Disable
if the user opted out of tracking in line with GDPR.
logLevel
DTDLogLevel (enum)
The level of logging the SDK activity. The DTDLogLevel.No
value is used by default. For troubleshooting during integration, it is recommended to set it to DTDLogLevel.Debug
, and either switch it off DTDLogLevel.No
or use it only for error handling DTDLogLevel.Error
in the release version.
ApplicationVersion
String
The app version during the devtodev SDK initialization. It is recommended that you set the app version before the initialization to make the collection of app version statistics more precise.
Example:
The SDK can’t control app activity hence this responsibility is passed on to the developer. During the SDK initialization, the activity is triggered automatically, and later the activity status will not change automatically. For tracking app activity, the developer can use the DTDAnalytics.StartActivity
and DTDAnalytics.StopActivity
methods. It is recommended that you use the DTDAnalytics.StopActivity
method to stop the activity when the app goes into the background or being closed. If the window is re-opened from the taskbar it is recommended to renew the activity by using the DTDAnalytics.StartActivity
method.
The latest up-to-date version of the Web SDK: 2.2
Please see the changelog if you are using an outdated version.
Please do the following to integrate your web application with devtodev:
Add the application to the Space using the wizard for adding applications.
To integrate SDK, add the following line to the tag of your page:
Initialize the SDK.
In order for SDK for WEB to start working, it is necessary to perform initialization right after the page is loaded and you have a basic user identifier at your disposal.
You can find the App ID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
– is an object that is used for specifying additional properties during initialization.
Config
Parameter
Type
Description
userId
string
Unique user identifier. For example, user’s ID in a social network, or a unique account name used for user identification on your server. If at the time of initialization this identifier is not yet available, specify the identifier later using
the setUserId
method.
currentLevel
integer
The player level at the moment of devtodev SDK initialization. Must be greater than 0. It’s optional but we recommend using it for improving data accuracy.
trackingAvailability
boolean
The property allows or disallows devtodev tracking of the user. By default, it is set to true
. SDK stores the previously assigned value. Pass false if the user opted out of tracking in line with GDPR.
logLevel
string
The level of logging the SDK activity. The "No
" value is used by default. For troubleshooting during integration, it is recommended to set it to "Debug
", and either switch it "No
" or use it only for error handling "Error
" in the release version.
applicationVersion
String
The app version. Cannot be empty.
Example:
Changelog
Added A/B test functionality (Beta)
Reserved user properties, which carry information about the user's personal data, are excluded from the SDK.
To integrate devtodev analytics SDK, you can use one of the two methods: by using the Unity Package Manager (recommended) or by manually importing the unitypackage.
If you integrated the devtodev package manually, then you need to delete the Assets/DevToDev and Plugins/DevToDev folders.
Open the Package Manager (Window → Package Manager), click + in the top left corner and select Add package from git URL.
Copy the repository URL https://github.com/devtodev-analytics/package_Analytics.git to the input box and click Add.
Wait for the Unity Package Manager to download the package.
For Android projects, add an identification package:
If you work with SDK version 3.5.0 and above, and you want to use Google Ad ID, you need to add devtodev-analytics/package_Google. When developing and publishing apps for kids (COPPA), you do not need devtodev-analytics/package_Google. Read more about working with COPPA in the COPPA section.
If you work with SDK version 3.5.0 and above, and you want to use Huawei Ad ID, you need to add https://github.com/devtodev-analytics/package_Huawei.git. When developing and publishing apps for kids (COPPA), you do not need https://github.com/devtodev-analytics/package_Huawei.git. Read more about working with COPPA in the COPPA section.
Download DTDAnalytics.unitypackage from http://github.com/devtodev-analytics/Unity-sdk-3.0/releases/latest.
In the Unity Editor menu, open Assets → Import Package → Custom Package.
Select the DTDAnalytics.unitypackage that you have just downloaded.
Click Import.
For Android projects, import an identification package:
If you work with SDK version 3.5.0 and above, and you want to use Google Ad ID, you need to import the DTDGoogle.unitypackage. When developing and publishing apps for kids (COPPA), you do not need the DTDGoogle.unitypackage. Read more about working with COPPA in the COPPA section.
If you work with SDK version 3.5.0 and above, and you want to use Huawei Ad ID, you need to import the DTDHuawei.unitypackage. When developing and publishing apps for kids (COPPA), you do not need the DTDHuawei.unitypackage. Read more about working with COPPA in the COPPA section.
Create a script with the following code and attach it to the GameObject
that will survive the entire life cycle of the app.
You can find the AppID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
- an object instance of DTDAnalyticsConfiguration
, which is used for specifying additional properties during the initialization.
DTDAnalyticsConfiguration
Parameter
Type
Description
CurrentLevel
Integer
The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.
UserId
String
A custom user ID assigned by the developer. In the case of default calculation by device IDs, the identifier can be used for searching users in devtodev. In case the project uses calculation by user IDs, the parameter is mandatory because it becomes the principal calculation ID in devtodev.
TrackingAvailability
DTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.Enable
. SDK stores the previously assigned value. Pass DTDTrackingStatus.Disable
if the user opted out of tracking in line with GDPR.
LogLevel
DTDLogLevel (enum)
The level of logging the SDK activity. The DTDLogLevel.no
value is used by default. For troubleshooting during integration it is recommended to set it to DTDLogLevel.Debug
, and either switch it off DTDLogLevel.No
. Use DTDLogLevel.No
in the release version.
ApplicationVersion
String
The app version during the devtodev SDK initialization. Use the property on the WinStandalone platform only. For all other platforms, data is collected automatically.
Example:
SDK Activity
The SDK can’t control app activity in case you use Windows Standalone therefore this responsibility is shifted to the developer. While initializing the SDK, the activity starts automatically and after that, the activity status will not auto-change. To track app activity, the developer can use the following methods: DTDAnalytics.StartActivity
and DTDAnalytics.StopActivity
. It is recommended to use the DTDAnalytics.StopActivity
method to stop activity when the app goes into the background or gets closed. You can use the DTDAnalytics.StartActivity
method to resume activity when the app gets reopened from the taskbar.
For other platforms, there is no need to manually call the DTDAnalytics.StartActivity
and DTDAnalytics.StopActivity
methods.
To resolve external android dependencies, you need to use External Dependency Manager for Unity.
Add the following strings to proguard.txt (read more about Unity proguard here):
Select your project in https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/myProject In the “General information” section find “App information” and download the “agconnect-services.json“ file.
If you imported the DTDGoogle package, delete the imported files Assets\Plugins\DevToDev\Android\DTDGoogleAndroid.dll and Assets\DevToDev\Analytics\Editor\GoogleDependencies.xml
Import the DTDHuawei.unitypackage manually from GitHub or use Unity Package Manager with DTDHuawei package.
In the assets/Plugins/Android/ folder create a settingsTemplate.gradle file with the following content:
Open Window → devtodev and select Create android plugin folder
Copy the “agconnect-services.json“ file to the Assets\Plugins\Android\devtodev.plugin folder
Open Assets → External Dependency Manager → Android ResolverAssets → External Dependency Manager → Android Resolver and click Resolve
To proguard add the following rule:
To integrate with Xcode, the SDK uses PostProcessBuild
in the DTDPostProcessAnalytics
and DTDPostProcessMessaging
scripts. If you use custom PostProcessBuild
scripts, add them callbackOrder
of less than 98
to avoid conflicts.
At WWDC23 Apple introduced new privacy manifests and xcframework signature. More information about it can be found here.
When developing and publishing apps targeted at children under 13 years old, you need to ensure special conditions for data processing. Any mobile app aimed at children or intended for users in a region with strict regulations on child online protection, must comply with current laws.
If your app has to comply with the legal requirements (COPPA), use the following recommendations:
Implement the CoppaControlEnable
method. The method disables collection of ad IDs and vendor IDs (IDFA, IDFV).
To comply with Apple’s guidelines, remove from Xcode project:
AppTrackingTransparency.framework
and all the links pointing to it.
AdSupport.framework
and all the links pointing to it.
Set IS_COPPA_ENABLED = true
in DTDPostProcessAnalytics.cs
(Assets/DevToDev/Analytics/Editor
)
Implement the CoppaControlEnable
method. The method disables collection of ad IDs and vendor IDs.
If you are using DTDGoogle or DTDHuawei from Unity Package Manager, disable it.
If you are using DTDGoogle.unitypackage, remove the following files:
If you are using DTDHuawei.unitypackage, remove the following files:
Call the CoppaControlEnable
method before SDK initialization. If the method was not called, the SDK will work as before.
The SDK is available in GitHub repository. Download the Source code (zip) of latest release. Unzip the archive and copy DTDAnalytics folder 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:
A class that implements analytic methods.
Header file:
A class that implements user card methods.
The class header:
SDK tracking status.
Header file:
Values:
Unknown = 0
- leave tracking unchanged
Enable = 1
- tracking enabled
Disable = 2
- tracking disabled
Example:
SDK logging level.
Header file:
Values:
Unknown = 0
- leave logging level unchanged
No = 1
- logging disabled
Error = 2
- logging of errors
Warning = 3
- logging of warnings and errors
Info = 4
- logging of information messages, warnings and errors
Debug = 5
- logging of debugging messages, informational messages, warnings and errors
Example:
Types of resource accumulation.
Header file:
Values:
Earned = 0
- earned resources
Bought = 1
- purchased resources
Example:
Predefined social media.
Header file:
Values:
Facebook = 0
Vkontakte = 1
Twitter = 2
Googleplus = 3
Whatsapp = 4
Viber = 5
Evernote = 6
Googlemail = 7
Linkedin = 8
Pinterest = 9
Reddit = 10
Renren = 11
Tumblr = 12
Qzone = 13
Example:
Referral properties.
Header file:
Values:
Source = 0
Medium = 1
Content = 2
Campaign = 3
Term = 4
Example:
An optional parameter of int32 type
Header file:
HasValue
bool
Option label
Value
int32
Parameter value
For your convenience, we implemented the conversion constructor:
Example:
An optional parameter of FString type.
Header file:
HasValue
bool
Option label
Value
FString
Parameter value
For your convenience, we implemented the conversion constructor:
Example:
Configuration of the analytics plugin.
Header file:
LogLevel
EDTDLogLevel
Logging level
CurrentLevel
FDTDOptionalInt32
Current level
UserId
FDTDOptionalString
User ID
ApplicationVersion
FDTDOptionalString
Application version (Windows)
TrackingAvailability
EDTDTrackingStatus
Tracking settings
Example:
Custom parameters of a custom event.
Header file:
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:
Parameters of the progression start event.
Header file:
Difficulty
FDTDOptionalInt32
Difficulty
Source
FDTDOptionalString
Source
Example:
Parameters of the progression completion event.
Header file:
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:
Header file:
Definitions:
User gender.
Header file:
Values:
Unknown = 0
Male = 1
Female = 2
Example:
appKey
FString
You can find it in the settings of the corresponding application in devtodev (Settings → SDK → Integration → Credentials → App ID)
appKey
FString
You can find it in the settings of the corresponding application in devtodev (Settings → SDK → Integration → Credentials → App ID)
config
FDTDAnalyticsConfiguration
Initialization parameters
The DevToDev SDK extends the Godot engine in a modular way and supports the following platforms: MacOS, iOS, Android.
Godot engine 4.0+ (Source code)
SCons 3.0+ build system.
SDK module source code (GitHub repository)
The SDK module is available in GitHub repository. Download the Source code of latest release and copy d2d_analytics folder to the modules(/godot/modules/
) folder of Godot engine source code.
To work in the Godot editor, compile the engine source code and the analytics module:
Find out more about compiling for MacOS
For initialization, add the following code at the start of your application:
You can find the AppID in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).
config
– an object instance of GDDTDAnalyticsConfiguration
, which is used for specifying additional properties during the initialization
Parameter
Type
Description
CurrentLevel
Integer
The player level at the moment of devtodev SDK initialization. It’s optional but we recommend using it for improving data accuracy.
UserId
String
A custom user ID assigned by the developer. In the case of default calculation by device IDs, the identifier can be used for searching users in devtodev. In case the project uses calculation by user IDs, the parameter is mandatory because it becomes the principal calculation ID in devtodev.
TrackingAvailability
GDDTDTrackingStatus (enum)
The property allows or disallows devtodev tracking of the user. By default, it is set to GDDTDTrackingStatus.Enable
. SDK stores the previously assigned value. Pass GDDTDTrackingStatus.Disable
if the user opted out of tracking in line with GDPR.
LogLevel
GDDTDLogLevel (enum)
The level of logging the SDK activity. The GDDTDLogLevel.No
value is used by default. For troubleshooting during integration it is recommended to set it to GDDTDLogLevel.Debug
, and either switch it off GDDTDLogLevel.No
. Use GDDTDLogLevel.No
in the release version.
Example:
Open the Export Template Manager to download and install templates:
Open a terminal, go to the root directory of the engine source code. Compile a custom template for MacOS (see Building export templates for MacOS), select Debug or Release build and processor architecture. To support both architectures in a single Universal 2 binary, use lipo:
The next step is to prepare a custom template as a macos.zip archive. Don't forget to add the DTDAnalytics native library, copy libDTDAnalytics.dylib
to macos_template.app/Contents/MacOS/
.
Open the Export menu and specify the path to the prepared custom template:
Open the Export Template Manager to download and install templates:
Open a terminal, go to the root directory of the engine source code. And compile a custom template for iOS (see Compiling for iOS). To work with the iOS simulator, compile the sources with the ios_simulator=yes
flag. To support both architectures in a single Universal 2 binary, use lipo:
The next step is to prepare a custom template as an ios.zip archive. Don't forget to add the DTDAnalytics native library, copy DTDAnalytics.xcframework
to ios_xcode/
.
In XCode project:
Add DTDAnalytics.xcframework
to the project (with Do Not Embed specified)
Create Bridging-Header. To do this, add any swift file to the project (don't delete it later) and select 'Create Bridging Header' in the dialogue box that appears.
Add frameworks:
AppTrackingTransparency.framework
AdSupport.framework
Click to install android templates:
After installing the template, an android folder will appear in your project.
Move the d2d_analytics/native/androidAnalytics.aar
to the android/plugins/ folder
in your project. You will also need to create an Analytics.gdap
file in android/plugins/
with the following content:
Next, Analytics should appear in the Plugins section, check it out:
The next step is to compile the Godot engine for Android (see Android compilation), choose debug or release build, and select the processor architecture.
After successful compilation execute the following commands:
In the next step in godot-4.0-stable/bin
you will see godot-lib.template_debug.aar
or
godot-lib.template_relaese.aar
.
You need to copy and replace this file to the previously installed template in your project at the path:
appName/android/build/libs/debug
- for debugging
appName/android/build/libs/release
- for release
After these steps, you are ready to export your Android app.
Make sure that Use Gradle Build
(in the Gradle Build section), Analytics
(in the Plugins section) and the previously compiled Architecture
(in the Architectures section) are selected.