Filters

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:

  1. In the left-hand navigation, under Channels & Links, click on Link Settings.
  2. On the General tab, scroll down to the Advanced Settings sections and click to expand.
  3. Click the Enable China Features box.
  4. In the China Advertising Terms and Conditions modal, click the I agree to the China Ads Terms and Conditions**.
  5. Click Continue.
1138

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.

  1. To build the .jar file, run the task makeJar.

  2. 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"/>

  3. Download the .aar file from the main dir and use it with the main Branch SDK as follows.

  4. Copy the .aar file in your app root directory -> libs -> Branch-IMEI-release-latestVersion.aar (create libs if needed)

  5. Add the support for libs inside your project/build.gradle:

allprojects {
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}
  1. Add the support for the Inside your app/build.gradle.
    implementation (name:'Branch-IMEI-release-latestVersion', ext:'aar')

  2. Call the following in your Application Class ->

onCreate(): import BranchDeviceImei
import io.branch.referral.deviceimei.BranchDeviceImei;
Branch.getInstance().addModule(BranchDeviceImei.get(this));