Godot (Beta)
Getting started (Godot)
Welcome to the Noctua SDK for Godot!
This guide explains how to install, configure, and use the Noctua analytics plugin in your Godot game project.
Overview
The Noctua Godot Plugin allows you to integrate Noctua Analytics directly into your Godot project.
It supports:
- SDK initialization
- Tracking custom events
- Tracking revenue events
Installation
Requirements
- Godot Engine 4.0 or later
- Android or iOS export templates
- Android API 21+ (Android 5.0)
- Minimum gradle version 7.5.1 (recommended gradle version 8+)
Download the Plugin
Clone or download the latest release of the Godot Noctua plugin from: https://github.com/NoctuaLabs/godot-noctua
Configuration
- Obtain the noctuagg.json configuration file from the Noctua Team.
- Copy the noctuagg.json file to the Assets/ directory in your project.
- If you get config files for 3rd-party services such as Firebase from us (google-services.json and GoogleService-Info.plist) please refer to this documentation for location to place the configuration file https://firebase.google.com/docs/android/setup#add-config-file
Firebase Configuration
To make the values in your google-services.json config file accessible to Firebase SDKs, you need the Google services Gradle plugin (google-services).
- In your root-level (project-level) Gradle file (<project>/build.gradle.kts or <project>/build.gradle), add the Google services plugin as a dependency:
Your structure should look like:
plugins {
id("com.android.application") version "7.3.0" apply false
// ... // Add the dependency for the Google services Gradle plugin
id("com.google.gms.google-services") version "4.4.2" apply false
id("com.google.firebase.crashlytics") version "2.9.5" apply false
}
In your module (app-level) Gradle file (usually <project>/<app-module>/build.gradle.kts or <project>/<app-module>/build.gradle), add the Google services plugin:
plugins {
id("com.android.application")
// Add the Google services Gradle plugin
id("com.google.gms.google-services")
// Add the Crashlytics Gradle plugin
id("com.google.firebase.crashlytics")
// ...
}
Facebook Configuration
Add your App ID and Client Token to your project's string file and update the manifest file. Do the following:
- Add string elements with the names facebook_app_id and facebook_client_token, and set the values to your App ID and Client Token. You can get the App ID and Client Token in noctuagg.json in the Facebook section. Your code looks like the following:
<string name="facebook_app_id">your app id</string>
<string name="facebook_client_token">your client token</string>
- Open the /app/manifests/AndroidManifest.xml file in your app project.
- Add meta-data elements to the application element for your app ID and client token:
<application android:label="@string/app_name" ...>
...
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
...
</application>
Reference: https://developers.facebook.com/docs/android/getting-started
Initialization
The SDK initializes automatically when your project starts, using the noctua.gd script.