LogoLogo
My AppsLive demoNewsArticles
  • Introduction
  • 📌Product updates: 2025
    • 2024
    • 2023
  • Getting Started
    • Registration
    • Adding a space
    • Adding an app to the space
  • Basic Events & Custom Events
  • Integration
    • Expert Tips
      • What to track
      • Payments & Anti-cheat
      • Check your integration
    • Integration of SDK 2.0+
      • SDK Integration
        • Android
        • iOS
        • macOS
        • Windows
        • Web
          • Web SDK Integration
          • Web SDK Releases
        • Unity
        • Unreal Engine
        • Godot Engine
      • Automatic payment tracking
        • App Store
        • Google Play
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anticheat methods
        • Track sessions
      • Push notifications
        • Android
        • iOS
        • Windows (UWP)
        • Unity
          • Android
          • iOS
          • Windows (UWP/WSA)
        • Unreal Engine
      • A/B testing
        • Description of A/B testing on the SDK side
        • Working with A/B tests in the devtodev interface
        • A/B testing examples
    • Integration of SDK 1.0+ (deprecated)
      • SDK Integration
        • iOS
        • Android
        • Windows 8.1 and 10
        • Web
        • Unity
        • Mac OS
        • Adobe Air
        • UE4
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anti-cheat Methods
      • Push Notifications
        • IOS
        • Android
        • Windows 8.1 and Windows 10
        • Unity
        • Abode Air
        • UE4
    • Test Devices
    • Server API
      • Data API 2.0
      • Subscription API
      • Push API
        • IOS
        • Android
        • Windows UWP
        • Windows
      • Raw Export
      • Labels API
      • Data API
    • Import historical data via API
    • Data Export
      • Data Export to Cloud Storage (BigQuery / Amazon S3)
  • 3rd Party Sources
    • Attribution Trackers
      • AppsFlyer
      • Adjust
      • Branch.io
      • Kochava
      • Tenjin
      • Tune (MAT)
      • Singular
      • Custom postback API
      • Facebook Ads referral decryption
    • App Marketplace Data
      • App Store Connect Stats
      • App Store Subscriptions
      • Google Play Console Stats
      • Google Play Subscriptions
      • AppGallery Connect Stats
    • Ad revenue
      • AdColony
      • AdMob
      • Facebook
      • MoPub
      • Unity Ads
      • Vungle
      • Ad revenue API
    • Cohort export
  • Reports and Functionality
    • Space-related Reports and Functionality
      • Overview
      • Custom dashboards & Reports
      • SQL
        • SQL tips
        • SQL Query examples
      • Audience overlap
    • Project-related Reports and Functionality
      • Overview
        • Real-Time Dashboard
        • Acquisition reports
        • Engagement reports
        • Monetization reports
        • In-game analysis reports
        • Cohort analysis
      • Reports
      • Push Notifications
        • Android Notifications
        • IOS Notifications
        • Windows Notifications
        • Button Templates
      • Predictions
      • Users & Segments
      • Filters
      • A/B Testing
      • Tuning
      • Settings
  • Metrics and Glossary
    • Ad networks metrics
    • Market Metrics
    • Prediction Metrics
    • SDK Metrics
    • Subscription metrics
  • Space Management
  • User Profile Management
  • Limits
  • Scenarios and Best Practices
    • Analytics use cases
    • Match-3
    • MMORPG Games
    • Hyper-Casual games
    • Social Casino
    • RPG games
    • Farming games
    • Non-gaming app
    • Acquisition Example
  • FAQ
    • Identification
    • Raw Data
    • All about data discrepancies
  • Slack
Powered by GitBook
On this page
  • Godot SDK integration
  • Requirements
  • The SDK module installation
  • SDK Initialization
  • Project export
  • Export for MacOS
  • Export for iOS
  • Export for Android

Was this helpful?

Export as PDF
  1. Integration
  2. Integration of SDK 2.0+
  3. SDK Integration

Godot Engine

PreviousUnreal EngineNextAutomatic payment tracking

Last updated 5 months ago

Was this helpful?

Godot SDK integration

The DevToDev SDK extends the Godot engine in a modular way and supports the following platforms: MacOS, iOS, Android.

Requirements

  • Godot engine 4.0+ ()

  • .

  • build system.

  • SDK module source code ()

The SDK module installation

The SDK module is available in . 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:

scons platform=macos arch=x86_64
scons platform=macos arch=arm64
lipo -create bin/godot.macos.editor.x86_64 bin/godot.macos.editor.arm64 -output bin/godot.macos.editor.universal

cp -r misc/dist/macos_tools.app ./Godot.app
mkdir -p Godot.app/Contents/MacOS
cp bin/godot.macos.editor.universal Godot.app/Contents/MacOS/Godot
cp modules/d2d_analytics/native/macos/libDTDAnalytics.dylib Godot.app/Contents/MacOS/
chmod +x Godot.app/Contents/MacOS/Godot
codesign --force --timestamp --options=runtime --entitlements misc/dist/macos/editor.entitlements -s - Godot.app

SDK Initialization

For initialization, add the following code at the start of your application:

var config = GDDTDAnalyticsConfiguration.new()
config.logLevel = GDDTDLogLevel.Debug
DTDAnalytics.InitializeWithConfig("AppID", config)

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:

var config = GDDTDAnalyticsConfiguration.new() 
config.logLevel = GDDTDLogLevel.No 
config.trackingStatus = GDDTDTrackingStatus.Enable 
config.currentLevel = 1 
config.userId = "unique_userId" 
DTDAnalytics.InitializeWithConfig("AppID", config)

Project export

Export for MacOS

Open the Export Template Manager to download and install templates:

scons platform=macos target=template_debug arch=x86_64
scons platform=macos target=template_debug arch=arm64
lipo -create bin/godot.macos.template_debug.x86_64 bin/godot.macos.template_debug.arm64 -output bin/godot.macos.template_debug.universal

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/.

cp -r misc/dist/macos_template.app .
mkdir -p macos_template.app/Contents/MacOS
cp bin/godot.macos.template_debug.universal macos_template.app/Contents/MacOS/godot_macos_debug.universal
cp modules/d2d_analytics/native/macos/libDTDAnalytics.dylib macos_template.app/Contents/MacOS/
chmod +x macos_template.app/Contents/MacOS/godot_*
chmod +x macos_template.app/Contents/MacOS/libDTDAnalytics.dylib
zip -q -9 -r macos.zip macos_template.app

Open the Export menu and specify the path to the prepared custom template:

Export for iOS

Open the Export Template Manager to download and install templates:

scons p=ios target=template_debug
scons p=ios target=template_release
scons p=ios target=template_debug ios_simulator=yes arch=x86_64
scons p=ios target=template_debug ios_simulator=yes arch=arm64

cp -r misc/dist/ios_xcode .
cp bin/libgodot.ios.template_debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
lipo -create bin/libgodot.ios.template_debug.arm64.simulator.a bin/libgodot.ios.template_debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a

cp bin/libgodot.ios.template_release.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
lipo -create bin/libgodot.ios.template_debug.arm64.simulator.a bin/libgodot.ios.template_debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a

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/.

cp -r modules/d2d_analytics/native/ios/DTDAnalytics.xcframework ios_xcode/
cd "ios_xcode"
zip -q -r ios.zip ./*
cd ..
cp "ios_xcode/ios.zip" ./

In XCode project:

  1. Add DTDAnalytics.xcframework to the project (with Do Not Embed specified)

  2. 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.

  3. Add frameworks:

    • AppTrackingTransparency.framework

    • AdSupport.framework

Export for Android

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:

[config]

name="Analytics"
binary_type="local"
binary="Analytics.aar"

[dependencies]

remote=[
    "com.google.code.gson:gson:2.8.9", 
    "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2", 
    "com.google.android.gms:play-services-ads-identifier:18.0.1",
    "com.devtodev:android-google:1.0.0"
    // Optional (recommended)
    "com.android.installreferrer:installreferrer:2.2"
    ]

custom_maven_repos=["https://repo.maven.apache.org/maven2/"]

Next, Analytics should appear in the Plugins section, check it out:

// Example. For debug on arm64v8 architecture use:
scons platform=android target=template_debug arch=arm64v8
//for release:
scons platform=android target=template_release arch=arm64v8

After successful compilation execute the following commands:

// Example. For debug on arm64v8 architecture use:
scons platform=android target=template_debug arch=arm64v8
//for release:
scons platform=android target=template_release arch=arm64v8

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.

You can find the AppID in the settings of the respective app in devtodev (Settings → SDK → Integration → ).

Open a terminal, go to the root directory of the engine source code. Compile a custom template for MacOS (see for MacOS), select Debug or Release build and processor architecture. To support both architectures in a single Universal 2 binary, use lipo:

Open a terminal, go to the root directory of the engine source code. And compile a custom template for iOS (see 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 compile the Godot engine for Android (see ), choose debug or release build, and select the processor architecture.

Source code
Python 3.6+
SCons 3.0+
GitHub repository
GitHub repository
Find out more about compiling for MacOS
Building export templates
Compiling
Android compilation
Credentials