Support Chinese Ad Attribution
DO NOT USE OUTSIDE CHINA
This guide is specific to China and cannot be used for the attribution of Android devices outside of China.
Overview
The mobile app market in China is unique in that there are hundreds of app stores with Google being a minor one. This requires a unique approach to supporting attribution for apps downloaded in China.
As attribution providers mainly rely on Google's advertising identifier (GAID) for attribution - which is not available via any other app store in China - a different device identifier must be used to accurately attribute installs in the Chinese mobile app market.
To this end, Branch built an Android plugin specifically to capture the IMEI (International Mobile Equipment Identity) of Open Source Android devices.
NOT COMPATIBLE WITH GOOGLE PLAY
Using this module in apps that are listed on the Play Store can cause the app to be removed from the store.
Enabling China Features
Before you can implement the Branch Android IMEI module, you must enable China Features in your Branch Account.
To enable China Features:
- In the left-hand navigation, under Channels & Links, click on Link Settings.
- On the General tab, scroll down to the Advanced Settings sections and click to expand.
- Click the Enable China Features box.
- In the China Advertising Terms and Conditions modal, click the I agree to the China Ads Terms and Conditions**.
- Click Continue.

SDK Implementation
GITHUB REPO ACCESS RESTRICTED
Before you can implement the Branch Android IMEI module, you must contact your account manager and accept the Terms of Service for using this feature.
The Android IMEI module is used by the main Branch Android SDK to inject IMEI data of the device in the requests.
The module checks whether Google Play Services is linked to the app. If yes, then it will not fetch the IMEI. Otherwise, it will pass the IMEI in the requests.
NOTE
If Google Play Services is present, but not linked, the request for IMEI will result in an error.
-
To build the
.jar
file, run the taskmakeJar
. -
To read the IMEI of the device, you need to add the following permission in the Manifest file:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
-
Download the
.aar
file from the main dir and use it with the main Branch SDK as follows. -
Copy the
.aar
file in your app root directory ->libs
->Branch-IMEI-release-latestVersion.aar
(create libs if needed) -
Add the support for libs inside your
project/build.gradle
:
allprojects {
repositories {
flatDir {
dirs 'libs'
}
}
}
-
Add the support for the Inside your app/build.gradle.
implementation (name:'Branch-IMEI-release-latestVersion', ext:'aar')
-
Call the following in your Application Class ->
onCreate(): import BranchDeviceImei
import io.branch.referral.deviceimei.BranchDeviceImei;
Branch.getInstance().addModule(BranchDeviceImei.get(this));
Updated 3 months ago