Get started

The Adjust Unity SDK enables you to measure attribution, events, and more in your Unity app. Follow the steps in this guide to set up your app to work with the Adjust SDK.

Important:
The Adjust SDK supports iOS 9 or later and Android API level 9 (Gingerbread) or later.

1. Get the Adjust SDK

To use the Adjust SDK in your Unity app, you need to add it to your project. You can download the latest version from our GitHub releases page.

To import the Adjust SDK to your Unity project:

  1. Open the Unity Editor.
  2. Select Assets -> Import Package -> Custom Package.
  3. Select the downloaded SDK package.

2. Integrate the SDK

The Adjust SDK contains a Unity prefab that includes a template game object and an Adjust script. You can use this script to configure the SDK. To open the prefab in the Unity editor:

  1. Add the prefab from Assets/Adjust/Adjust.prefab to your first scene.
  2. Open the prefab Inspector Menu.

The prefab menu contains editable fields that control the behavior of the Adjust SDK.

To set up the Adjust SDK, enter the following information:

  1. Your App Token. See App settings for instructions on how to find your token.
  2. Your Environment:
    • Choose Sandbox if you are testing your app and want to send test data. You need to enable sandbox mode in the dashboard to see test data.
    • Choose Production when you have finished testing and are ready to release your app.
  3. Your Log Level. This controls what logs you receive. See Set log level for more information.

The Adjust SDK starts when the app's Awake event triggers by default. To override this behavior, check the START SDK MANUALLY option. This enables you to initialize the Adjust SDK by calling Adjust.start() with your config instance as an argument.

C#
AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox);
…
Adjust.start(adjustConfig);

3. Set up Android devices

Add Google Play Services

Apps that target the Google Play Store must use the Google Advertising ID (gps_adid) to identify devices. You need to add the play-services-ads-identifier AAR to your project to access the gps_adid.

Google External Dependency Manager

Manual installation

Collect App Set Identifier

Note:
The App Set ID is available in Adjust SDK v4.33.1 and above.

The App Set Identifier is a unique identifier that enables you to measure information from any of your apps that a user has installed on their device. All apps by the same developer share the same App Set ID, meaning you can gather meaningful insights from users across all your apps.

Google External Dependency Manager

Manual installation

Set up Proguard

If you are using Proguard, add the following rules to your custom Proguard file.

-keep public class com.adjust.sdk.** { *; }
-keep class com.google.android.gms.common.ConnectionResult {
    int SUCCESS;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
    com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
    java.lang.String getId();
    boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }

Set up install referrer

The install referrer is a unique identifier which you can use to attribute an app install to a source. The Adjust SDK requires this information to perform attribution. There are two methods you can use to gather this information depending on which stores you target:

Google Play Referrer API

Huawei Referrer API

Meta referrer integration

4. Add the iOS privacy manifest

iOS 17 introduced Privacy manifests, a mechanism that informs the App Store of your app's privacy requirements. The Adjust Unity SDK doesn't bundle this Privacy manifest file, so you need to ensure the contents of the Adjust iOS SDK Privacy manifest file are present in your app's Privacy manifest if your app targets devices running iOS 17 or later.

To add the Adjust Privacy manifest:

  1. Ensure you're using Adjust Unity SDK v4.38.0 or greater.
  2. Create a Privacy manifest if you haven't already.
  3. Download the PrivacyInfo.xcprivacy file from GitHub or copy its contents.
  4. Make sure the content of Adjust's PrivacyInfo.xcprivacy file is present in your own Privacy manifest file.

When you submit your app to the App Store, Adjust's privacy declarations are included with your app.

5. Build your app

To complete the app build process, the Adjust Unity package performs custom post-build actions to ensure the Adjust SDK works properly in your app.

This process is performed by the OnPostprocessBuild method in AdjustEditor.cs. Output logs show up in the Unity IDE console output window.

iOS

Android

6. Add the Adjust SDK signature

You can use the Adjust SDK signature to sign all communications sent by the Adjust SDK. This enables Adjust’s servers to detect and reject any install activity that is not legitimate.

To get started with the Adjust SDK signature, contact your Technical Account Manager or support@adjust.com.

7. Test your integration

The Adjust SDK provides tools for testing and troubleshooting issues with your integration. To test your setup:

Tip:
If you encounter any issues, email support@adjust.com with all details and logs.

Test Google Play Services integration