Integrate with Unity Ads
This page covers every SDK platform and version. A part that applies only to some platforms starts with Platform: …, and a part that applies only to some SDK versions starts with SDK version: ….
If you use Unity Ads, you can automatically track Advertisement revenue from Impressions with justtrack SDK.
Before you begin
Please review the following compatibility matrix to make sure you're using compatible versions:
| justtrack SDK | Unity Adapter | Unity SDK |
|---|---|---|
| 6.0.0+ | 1.x | 4.x |
Integrate with Unity Ads
First, add the adapter dependency to your package manager:
- Kotlin
- Groovy
dependencies {
implementation("io.justtrack:adapter-unityads:1.0.0")
}
dependencies {
implementation "io.justtrack:adapter-unityads:1.0.0"
}
Then, initialize the adapter, and integrate it with the justtrack SDK:
import io.justtrack.integrations.unityads.UnityAdsIntegrationAdapter
// Integrate the adapter while you build the SDK
val sdk = JustTrackSdkBuilder(this, API_TOKEN)
.addIntegrationAdapters(UnityAdsIntegrationAdapter())
.build()
// Or after...
sdk.integrateWith(UnityAdsIntegrationAdapter())
If you use Unity Ads, you can automatically track Advertisement revenue from Impressions with justtrack SDK.
Before you begin
Please review the following compatibility matrix to make sure you're using compatible versions:
| justtrack SDK | Unity Adapter | Unity SDK |
|---|---|---|
| 6.0.0+ | 1.x | 4.x |
Integrate with Unity Ads
First, add the adapter dependency to your package manager:
- Cocoa Pods
- Carthage
pod 'JustTrackSDKUnityAdsAdapter', '~> 1.0.0'
binary "https://sdk.justtrack.io/carthage/JustTrackSDKUnityAdsAdapter.json"
Please note we don't support Swift Package Manager for Unity Ads.
Then, initialize the adapter, and integrate it with the justtrack SDK:
import JustTrackSDK
import JustTrackSDKUnityAdsAdapter
// Build the SDK
let sdk = try JustTrackSdkBuilder(apiToken: apiToken)
.set(trackingId: trackingId, trackingProvider: trackingProvider)
.build()
// Integrate the Unity Ads adapter
sdk.integrate(with: JusttrackUnityAdsAdapter())
Unity Ads automatic integration is not available for React Native right now.
Platform: UnityIf you use Unity Ads, you can automatically track Advertisement revenue from Impressions with justtrack SDK.
Before you begin
Review the following compatibility matrix to make sure you're using compatible versions. Automatic uses the default version.
| Platform | Unity Ads Adapter | Unity Ads SDK |
|---|---|---|
| Android | 1.x (default) | 4.x |
| iOS | 1.x (default) | 4.x |
Integrate with Unity Ads
- In the Unity Editor, navigate to the justtrack SDK configuration prefab.
- Select the Android or iOS tab, and enable Add Unity Ads Adapter. This adds the Unity Ads adapter to your project for that platform.
- Optional: In Adapter Version, choose the adapter version that matches your Unity Ads SDK. See Choose an adapter version.
- Call the integration method in your code:
using JustTrack;
// Call this after SDK initialization
JustTrackSDK.IntegrateWithUnityAds(
pOnSuccess: () => {
Debug.Log("Unity Ads integration successful");
},
pOnFailure: (error) => {
Debug.LogError($"Unity Ads integration failed: {error}");
}
);
Choose an adapter version
You can choose which adapter version the justtrack SDK adds to your project. After you enable an adapter, an Adapter Version menu appears below it with these options:
- Automatic: Uses the default adapter version for your installed justtrack SDK. Use this option unless your third-party SDK version needs a different adapter.
- A specific version, such as 1.0.0 or 2.0.0: Uses the latest stable release of that major version. Choose the version that matches your third-party SDK in the compatibility matrix.
- Custom: Lets you enter any version. Enter an adapter version that's already published. If the version doesn't exist, the justtrack SDK uses the default version instead.
A Unity Ads integration isn't available for the justtrack Flutter SDK yet. To track ad revenue from Unity Ads, forward each impression with .forwardAdImpression(). See Track ad impressions.
A Unity Ads integration isn't available for the justtrack Godot SDK yet. To track ad revenue from Unity Ads, forward each impression manually. See Track ad impressions.
Platform: UnrealA Unity Ads integration isn't available for the justtrack Unreal SDK yet. To track ad revenue from Unity Ads, forward each impression manually. See Track ad impressions.
Platform: GodotA Unity Ads integration isn't available for the justtrack Godot SDK yet. To track ad revenue from Unity Ads, forward each impression manually. See Track ad impressions.
Platform: UnrealA Unity Ads integration isn't available for the justtrack Unreal SDK yet. To track ad revenue from Unity Ads, forward each impression manually. See Track ad impressions.