Skip to main content

Install SDK

NoteThe Airbridge Unity SDK requires Unity version 2018.4 or later.
AttentionThe Airbridge Unity SDK uses the Unity Jar Resolver, the External Dependency Manager for Unity, to manage library dependencies.For Airbridge Unity SDK v1.9.2 and earlier, the following setup is required.
  1. Set up the Unity package by referring to the repository below.
  2. Set up the EDM4U by referring to the setup guide below.
For Airbridge Unity SDK v.1.9.3 and later, the above setup is unnecessary as the SDK automatically imports all Airbridge plugins and EDM4U assets.

Install package

  1. Download the latest version of the Airbridge Unity SDK.
  2. Navigate to [Assets] >[Import Package]>[Custom Package…] in Unity and add the package file.
  3. The [AB180] tab will appear in the top menu bar once the package is installed.

Set up project

Navigate to [AB180]>[Airbridge Settings] in the top menu bar to open the following screen.
AttentionAfter filling out the fields, click Update iOS App Setting or Update Android Manifest to apply changes.
AttentionIf you want to manually merge the Android Manifest file, navigate to [Project]>[Plugins]>[Airbridge]>[Android] and refer to the AndroidManifest.xml file.

Set up app information

In the Airbridge dashboard, navigate to [Settings]>[Tokens] and copy the App Name and Token.
Then, go to Unity, navigate to [AB180]>[Airbridge Settings] in the top menu bar, and paste the App Name and App Token into the respective fields.

Initialization

The Airbridge Unity SDK does not require initialization. However, in particular cases, a migration process may be required per platform.

Set up Application Entry Point

When using the Unity version 2023.1 or later, you can navigate to [Android Player Settings]>[Other Settings]>[Configuration]>[Application Entry Point] and set the “Application Entry Point” to Activity, GameActivity, or Activity and Game Activity. Refer to the information below to learn about the additional configurations that are required depending on how the “Application Entry Point” is set.
The Android Manifest file is automatically updated with the value entered in the [AB180]>[Airbridge Settings], and therefore, no action is required.
v1.16.3 or later
The Android Manifest file is automatically updated with the value entered in the [AB180]>[Airbridge Settings], and therefore, no action is required.
v1.16.2 or earlier
The custom Activity provided by the Airbridge Unity SDK is an Activity that inherits from com.unity3d.player.UnityPlayerActivity, and therefore, the following actions are required.
  1. Remove the Assets/Plugins/Airbridge/Android/java/co/ab180/airbridge/unity/AirbridgeActivity.java file.
  2. Create a Custom Activity file (AirbridgeGameActivity.java) as follows.
  1. Register the Custom Activity as follows in the Android Manifest file ({UNITY_PROJECT}/Plugins/Android/AndroidManifest.xml).
AttentionFor development purposes, you can set up 2 application entry points.
v1.16.3 or later
  1. Refer to the AirbridgeActivity.java.template file and AirbridgeGameActivity.java.template file located inside the {UNITY_PROJECT}/Plugins/Airbridge/Android/java/co/ab180/airbridge/unity folder to create your activities.
  2. Apply each activity to your Android Manifest file.
  3. The Android Manifest file will then be automatically updated with the values set in the [AB180]>[Airbridge Settings].
v1.16.2 or earlier
Airbridge Unity SDK does not provide a custom Activity that inherits from com.unity3d.player.UnityPlayerGameActivity, and setting the Intent Filter to the value set in the “AB180 → Airbridge Settings” is only automatic for one Activity, so the following additional work is required.
  1. Create a Custom Activity file (AirbridgeGameActivity.java) as follows.
  1. Set the Android Manifest file ({UNITY_PROJECT}/Plugins/Android/AndroidManifest.xml) as follows.
  • YOUR_APP_NAME: App Name set in the [AB180]>[Airbridge Settings] at the top menu bar in Unity
  • YOUR_APP_URI_SCHEME: Android URI Scheme set in the [AB180]>[Airbridge Settings] at the top menu bar in Unity
If you did not set the Application Entry Point, follow the guides below to complete the setup.

SDK testing

After completing the Airbridge Unity SDK setup, you can test whether it works properly by following the methods below.

Using the Airbridge Dashboard

  1. Install and open the app on a test device.
  2. Navigate to [Raw Data]>[App Real-time Logs] in the Airbridge dashboard.
  3. Enter the Google Advertising ID (GAID) of the test device to find it in the logs.
It may take up to 5 minutes for the logs to be visible in the dashboard.
AttentionIt may take up to 5 minutes for the logs to appear on the [Real-time Logs] page.

Using the logs

Navigate to [AB180]>[Airbridge Settings] in Unity and check the Log Level.

Deep Linking

Set up dashboard

Refer to the guides below to set up the Airbridge dashboard for deep linking.

Set up project

iOS

Navigate to [AB180]>[Airbridge Settings] in Unity and enter the iOS URI Scheme, which can be found on the [Tracking Link]>[Deep Links] page in the Airbridge dashboard.

Android

Navigate to [AB180]>[Airbridge Settings] in Unity and enter the Android URI Scheme, which can be found on the [Tracking Link]>[Deep Links] page in the Airbridge dashboard.

Set up a custom domain

When generating tracking links in the Airbridge dashboard, you can use tracking links in the form of deeplink.page or abr.ge. However, for branding purposes and to improve click-through rates (CTR), you can use customized URLs as tracking links, such as go.my_company.com/abcd, by following the steps below.
  1. Set up the custom domain in the Airbridge dashboard by referring to this user guide.
  2. Navigate to [AB180]>[Airbridge Settings] in Unity and enter the custom domain.
To receive the deep link data clicked by the user, register the object name using SetDeeplinkCallback to receive messages like below.
Airbridge will receive the deep link URL once SetDeeplinkCallback is set as above.
The Airbridge Unity SDK uses Unity’s UnitySendMessage method to forward deep link information.
Click on your URI scheme to test if your deep link has been properly set up in the Airbridge SDK.
  • YOUR_APP_URI_SCHEME://
When the deep link setup is successful, you will see the Deeplink Open event on the [Raw Data]>[App Real-time Log] page in the Airbridge dashboard, like in the following image.

User Data

User identifier

To measure the fragmented contributions of users between web and app, Airbridge collects the following user identifier information.
  • User Email: Email address
  • User Phone: Phone number
  • User ID: Unique User ID (The ID value that specifies the user must be the same in both web and mobile)
  • User Alias: Identifiers that can represent users (e.g. loyalty program ID, affiliate integrated ID, etc)
The user’s email and phone numbers are hashed (SHA256) by default and then sent to servers.
You can set the user identifier as below for the SDK.
Once the user identifier has been configured, all events will be forwarded with the corresponding identity information.
AttentionThe user identifier properties can be reset or overwritten through user events.

User Attribute

Additional user attributes can be used for more accurate Multi-Touch Attribution (MTA) analyses, additional internal data analyses, and linking third-party solutions.
AttentionThe user identifier properties can be reset or overwritten through user events.

Testing

Make sure that your user information settings are being properly sent through the SDK.
  1. Configure user identifier information.
  2. Send an event using the SDK.
  3. Click the event at “Airbridge dashboard → Raw Data → App Real-time Logs”
  4. Check if the user information is correctly sent under the userblock.

Device Setup

Setup Device Alias

Setup a device alias through the Airbridge SDK. The alias will be sustained even after the app closes, unless otherwise deleted.

Event Setup

When important user actions occur, in-app events can be sent to measure performance by channel. All event parameters are optional. However, more information about the event will help provide a more accurate analysis. All events called by the Airbridge SDK can be sent with the following fields.

Standard Events

Send standard user events with the SDK. actionlabelvalueattributes can also be used when sending standard events.

Sign Up

Sign In

Sign Out

AttentionAll user identifier properties will disappear after sign out is called.

View Home Screen

View Search Result

View Product List

View Product Detail

Add To Cart

Purchase

Custom Events

Send custom events with the SDK.
To configure and deliver Semantic Attributes directly, please refer to this guide.

Verify Event Transmission

Make sure that the events are being properly sent through the SDK.
  1. Send an event with the SDK.
  2. Check if the event shows up at “Airbridge dashboard → Raw Data → App Real-time Logs”.

Advanced Setup


SDK Signature Setup

Protection against SDK spoofing is possible once you input the “SDK Signature Secret ID” and “SDK Signature Secret” values in the “AB180 -> Airbridge Settings menu”.
The SDK Signature Credentials are required for the SDK Signature setup. Refer to this article to learn how to create them.

Hash User Identifier

Email addresses and phone numbers are hashed by default. (SHA256) Settings can be changed by configuring the “User Info Hash Enabled” field at “AB180 → Airbridge Settings”.
AttentionOther security measures must be taken internally when sensitive personal information such as “User Email” and “User Phone” is being handled.

Session Timeout Setup

The Airbridge Unity SDK does not send app open events again if the user reopens the app within the time configured at the “Session Timeout Seconds” field at “AB180 → Airbridge Settings”. Session timeout is in milliseconds and must range between 0 and 604800000 (7 days). The default value is 1000 * 60 * 5 (5 minutes).

Setting up Opt-In

This feature is useful for conducting data collection and transmission in compliance with GDPR or CCPA. You can explicitly start data collection and transmission by navigating to AB180 > Airbridge Settings in the top menu bar of Unity, and selecting the Auto Start Tracking Enabled field. When this feature is disabled, the following function must be explicitly called for proper data collection.

Setting up Opt-Out

AttentionThe instructions below are optional. Proceed only if necessary.
Opt-Out is a policy where user information is used until the user refuses. After setting setAutoStartTrackingEnabled to true, call the stopTracking function at the point where events cannot be collected. From the point when the stopTracking function is called, events are not collected.
If it is difficult to see the performance of re-engagement through Airbridge at a glance due to too many deep link actions within the advertiser’s app, “Track Airbridge Link Only” field at “AB180 → Airbridge Settings” can be used to only filter results received through Airbridge deep links. This option will measure deep links only if the following requirements are met.
  • The app is opened through a airbridge.iolink
  • The app is opened through a deeplink.pagelink
  • The app is opened through a Custom Domain Setup that is registered on the Airbridge dashboard
  • The app is opened through a link that contains airbridge_referrerinformation in the query

Location Collection (Android only)

Airbridge Unity SDK can collect user location information through the “Location Collection Enabled” field at “AB180 → Airbridge Settings”
AttentionLocation information must be collected for legal purposes through legal methods.
You can receive Facebook Deferred App Links from the Airbridge Unity SDK through by configuring “Facebook Deferred App Link Enabled” at “AB180 → Airbridge Settings”.
AttentionThe Facebook SDK setting must be installed in advance to use this feature.See - https://developers.facebook.com/docs/unity/

Tracking Authorize Timeout (iOS only)

When the AppTrackingTransparency.framework is used to present an app-tracking authorization request to the user, IDFA will not be collected when the install event occurs because the install event occurs before the selection. The “iOS Tracking Authorize Timeout Seconds” field at “AB180 → Airbridge Settings” allows you to delay the transmission of installation events so that the IDFA value may be included.

Meta install referrer Collection Setup

Meta install referrer (MIR) Collection Setup supported by Airbridge Unity SDK in version 1.16.1 or higher. To collect data, set as below. You can pass your Facebook App ID through by configuring “Meta Install Referrer (Facebook App ID)” at “AB180 → Airbridge Settings”.
After adding the settings, you must enter the decryption key to see decrypted MIR. Refer to this article to learn about MIR.

Uninstall Tracking

This feature is available for only Unity SDK v1.9.0+.
Reference
Android Uninstall Tracking
1. Setup Firebase Cloud Messaging Please refer to the official Firebase Cloud Messaging documentation for basic app setup. 2. Forward Firebase Push Token Forward the push token to Airbridge using the RegisterPushToken method.
iOS Uninstall Tracking
1. Setup Apple Push Notification Service Please refer to the official Unity Mobile Notifications Package documentation and install the package. 2. Forward Device Token Forward the device token to Airbridge using the RegisterPushToken method.

Hybrid App Setup


Additional events such as app installs, app open,s and deep link opens can’t be tracked with just the web SDK. The following simple setup allows in-app events to be called for a hybrid app.
AirbridgeUnity.CreateWebInterface allows you to control the web interface. Please refer to the Unity Hybrid App Integration Guide for more information.
AttentionHybrid app setup is available for Airbridge Unity SDK v1.9.3+.

Troubleshooting


Android

Airbridge Unity SDK does not seem to initialize correctly

The Airbridge Unity SDK for Android initializes automatically through Content Provider. For proper initialization, the following XML tag must be correctly placed in “Project → Plugins → Android → AndroidManifest.xml”.

Using your own custom activity class

The Airbridge Unity SDK uses custom activities in “UnityPlayerActivity” to get deep link data. If you are using your own custom activity class, please override the following codes inside your custom activity class.

The AndroidManifest file does not seem to merge properly

The “AndroidManifest Merger” that the Airbridge Unity SDK provides is a simple component that merges “Project → Plugins → Android → AndroidManifest.xml” and “Project → Plugins → Airbridge → Android → AndroidManifest.xml”. The merge may not satisfy all cases, and you will have to separately merge your “AndroidManifest.xml” file with reference to “Project → Plugins → Airbridge → Android → AndroidManifest.xml”.

Missing ‘package’ key attribute on element package at …

Due to the addition of Android 11’s Package Visibility policy, applications should be properly informed by <queries> inside the manifest file about which packages are used in order to properly interact with another applications. The Airbridge SDK is compliant with the policy and requires Gradle v5.6.4+ and Android Gradle Plugin v3.6.0+ to support the <queries> tag. Please refer to this page for information on which version of Gradle is used by Unity.
No further action is required because the necessary Gradle and Android Gradle plugin exists.
The following customization is supported only on Unity 2019.3 patch 7 and later.
  1. Go to the Gradle Build Tool page and download Gradle v5.6.4 or higher
  2. Go to “Preferences → External Tools” to uncheck “Gradle Installed with Unity (recommended)” and set the path to the downloaded Gradle file as below.
  1. Go to “Project Settings → Player → Android Tab → Publishing Settings → Build” and select the following options:
    1. Custom Main Gradle Template
    2. Custom Launcher Gradle Template
  1. Please change both of the following auto-generated files as follows
    1. Assets/Plugins/Android/mainTemplate.gradle
    2. Assets/Plugins/Android/launcherTemplate.gradle
  1. Go to the Gradle Build Tool page and download Gradle v5.6.4 or higher.
  2. Go to “Preferences → External Tools” to uncheck “Gradle Installed with Unity (recommended)” and set the path to the downloaded Gradle file as below.
  1. Go to “Project Settings → Player → Android Tab → Publishing Settings → Build” and select “Custom Gradle Template”.
  1. Go to the auto generated “Assets/Plugins/Android/MainTemplate.gradle” file and make the following changes.
The following customization is supported only on Unity 2018.4 patch 24 and later
  1. Go to the Gradle Build Tool page and download Gradle v5.6.4 or higher.
  2. Go to “Build Settings → Android” and set “Build System” to “Gradle” to use a custom version of Gradle.
  1. Go to “Preferences → External Tools”, uncheck “Gradle Installed with Unity (recommended)” and set the path to the downloaded “Gradle” file.
  1. Go to “Project Settings → Player → Android Tab → Publishing Settings → Build” and select the “Custom Gradle Template” option.
  1. Go to the auto generated “Assets/Plugins/Android/MainTemplate.gradle” file and make the following changes.
Gradle customizations are not supported on these versions of Unity and are not compatible with the necessary changes to support Android 11 (API level 30).

Resolve Airbridge SDK backup rules merge conflict issue

If you are experiencing build errors caused by overlapping of the Airbridge SDK backup rules and third-party SDK backup rules, please refer to the workaround below. e.g) If you have an Airbridge SDK backup rule and an Appsflyer SDK backup rule that overlap, you will see the build error below.
To resolve this issue, please set up as follows.
  1. Create an Android Library project (Assets/Plugins/Android/res.androidlib) to store your resource files.
  2. Add an AndroidManifest.xml file in the created Android Library Project as follows.
  1. Create a res/xml folder inside the created Android Library Project.
  2. Create a file (e.g. custom_backup_rules.xml) within the created xml folder.
  3. Add the data backup rules defined by the Airbridge SDK as follows.
Apply the data backup rules to the Android App Manifest file (Assets/Plugins/Android/AndroidManifest.xml) as follows.
For more guidance, refer to the articles below.

iOS

AttentionThis troubleshooting guide is for customers who need to migrate an existing AppDelegate-based app to UIScene(SceneDelegate) lifecycle.
Symptoms
  • When an app built with Xcode 27 is launched, the app may not run properly.
  • Airbridge deep link events are not collected even when the app is opened through a scheme deep link or Universal Link.
  • The app does not work even though the code was added to AppDelegateas shown in the Initialize SDK and Collect deep link events in your app developer guide examples.
Cause
Apple is moving the app lifecycle from the UIApplicationDelegate-only AppDelegate model to the UIScene-based SceneDelegate model, and adopting the Scene lifecycle has effectively become required in the latest Xcode and iOS environments. When an app adopts the Scene lifecycle through UIApplicationSceneManifest, the following AppDelegate deep link callbacks are no longer called.
Solution
The required steps depend on the Unity Engine and Airbridge SDK versions. Starting with the Unity Engine versions listed below, Unity generates UnityScene when creating an Xcode project.
Unity versions that support UnityScene
Use one of the listed versions or later. If you are using a version that does not support UnityScene, you need to add a separate UIScene.
Versions that do not support UnityScene
In the SceneDelegate file where a UIScene has been added in Unity, call the public deep link interface in AirbridgeUnity.h.
Versions that support UnityScene
In the UnityScene file of the Xcode project generated by Unity, call the public deep link interface in AirbridgeUnity.h.

Using your own custom AppController

Airbridge Unity SDK uses IMPL_APP_CONTROLLER_SUBCLASS to create a custom AppController. If you are using your own custom AppController, add the following code to your custom AppController.
  • Please remove the “Assets → Plugins → Airbridge → iOS → Delegate → AUAppController.mm” file once the above change has been made.

The issue with the app closing instantly upon launch on iOS

Text
If you are using Airbridge Unity SDK version 1.14.1 or 1.16.2, Please update to version 1.16.3.

The issue with no compatible version found for AirBridge on iOS

Text
If you can’t find a compatible AirBridge version on iOS, execute the command below to update the source repository.
After updating your source repository, run the pod search AirBrdige command to verify that the correct AirBridge version exists in your repository, and then proceed with the iOS build.

Sample App

Unity Sample App

Migration Guide

Before updating the SDK, please review the following information.

1.14.1

With support for the privacy manifest, the Static Library has been changed to a Dynamic Library. If you are installing using EDM4U, click on [Assets]>[External Dependency Manager]>[iOS Resolver]>[Settings] at the top of Unity to proceed with iOS builds after unchecking the ‘Link frameworks statically’ checkbox in the Podfile Configurations section of the iOS Resolver Settings window displayed.