menu User Guide
개발자 가이드 chevron_right SDK 설치
React Native Android Bridge SDK
Airbridge React Native Android Bridge SDK

To Install and Setting

With npm, install airbridge react-native sdk

npm install react-native-airbridge-bridge

after installation, you can link your project with the below command.

react-native link react-native-airbridge-bridge

Open file 'build.gradle' in app module of your project folder(normally in 'app/'), add below code to 'dependencies' block.

dependencies {
    ...
    compile 'io.airbridge:sdk-android:1.4.+'
    ...
}

Configuration of 'AndroidManifest.xml'

Please add the following permission to AndroidManifest.xml.

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE"/>
      <uses-permissionandroid:name="android.permission.CHANGE_WIFI_STATE"/>
      <uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/>

Google Play Install Referrer API Integration (Detecting Fraud)

Please add Google Play Install Referrer API library to build.gradle file on app as follows. With a line break, integration with Google Play Install Referrer API will be completed.

dependencies {
    ...
    compile 'com.android.installreferrer:installreferrer:1.0'
    ...
}

Setting for Proguard

[Proguard] If you are using Proguard (https://d.android.com/studio/build/shrink-code.html), kindly refer to the following details.

In Android Studio, insert the following to the ‘lib-proguard-rules.txt’ file.

-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {public *;}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { public *;}
-keep class com.android.installreferrer.api.InstallReferrerClient {public *;}
-keep class com.android.installreferrer.api.InstallReferrerClient$newBuilder { public *;}
-keep class com.android.installreferrer.api.InstallReferrerClient$Builder { public *;}
-keep class com.android.installreferrer.api.ReferrerDetails {public *;}
-keep class com.android.installreferrer.api.InstallReferrerStateListener {public *;}
-keep class io.airbridge.deviceinfo.** { *; }

In Eclipse, insert the following to the proguard-rules.pro file.

-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {public *;}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { public *;}
-keep class com.android.installreferrer.api.InstallReferrerClient {public *;}
-keep class com.android.installreferrer.api.InstallReferrerClient$newBuilder { public *;}
-keep class com.android.installreferrer.api.InstallReferrerClient$Builder { public *;}
-keep class com.android.installreferrer.api.ReferrerDetails {public *;}
-keep class com.android.installreferrer.api.InstallReferrerStateListener {public *;}
-keep class io.airbridge.deviceinfo.** { *; }

Quick Setting

In javascript of React-Native, you can declare it such as the below for calling Airbridge API.

const AirbridgeApi = require('react-native-airbridge-bridge');

Initialize Airbridge SDK as the below along initializing point of app.

...
AirbridgeApi.init('[app name]', '[app token]');
...

'app name' and 'app token' can be checked by navigating Dashboard ('app information > app basic information'.

To Test SDK Execution

  1. Before testing, you have to delete the app on device.
  2. Build the app to launch on device.
  3. Airbridge Dashboard → app selection → select 'Check SDK Installation' in 'Management' category of sidebar menu
  4. Check the value as 'Device UUID (Android GAID)' in 'Check Mobile SDK Installation' menu.
  • To Check Android GAID : In Android device, 'Setting' → Google Setting → Ad → "Ad ID", value of it is Android GAID
  • In Menu 'Check Mobile SDK Installation', if 'Device UUID(Android GAID)', it is not showed,please check again that you did according to this Quick Setting.
  • There will be 5 minutes delay(max) for showing Log.

To Integrate User Identity

Airbridge is a “People-based Analytics” service which integrates app, web, and offline ad performance analysis which stretches beyond the domain of mobile app.

To reach a purchase (conversion), a single user will go through multiple devices, platforms, and browsers, to ultimately reach to order placement based on compiled information through the process.

In this regard, data collected from a single device and/or single platform carries a limitation to perform a fragmented analysis. However, Airbridge’s People-Based analysis enables an integrated conversion analysis of the whole user because it bridges varying contact points across web, app, and offline platforms to a single user.

UserID & UserEmail Setup

As one method to User Identity integration, Airbridge strongly recommends at least one of ‘UserID’ or ‘UserEmail’ to be configured during Android SDK install, as details below.

By calling and saving the following method on setting, you can setup UserID and UserEmail. We recommend calling methods to activities with sign-in/sign-up or app’s default activity (introduction).

AirbridgeApi.setEmail('[User Email]');
AirbridgeApi.setUser('[User ID]');
  • When calling this method, we strongly recommend that you save at least one value between UserID and UserEmail for effective data analysis.
  • Once this method is called, all values for user information will be hashed (SHA256) for it to be sent and managed.
  • For UserID and UserEmail of internal use, this method will retrieve that value again from S3 in csv format (externalUserID, externalUserEmail), so that funnel and/or attributed path as well as integration of identified user’s data can be confirmed. Later, it could also be used for cross-platform user matching.

To Configure Default In-app Events

After app install, user’s meaningful actions (conversions) can be registered as in-app events and you can measure performances by varying funnel and attributed paths.

The commonly used “sign up”, “sign in”, “look up home”, ““look up product list”, ““look up search result”, ““look up product details”, “add to cart”, and “purchase” features will be offered with a separate method as a default in-app event. Also, for custom in-app events, when dynamically calling method from SDK, the result data could be found from Dashboard once a single action is executed.

Airbridge basically supports a sum of 8 default in-app events. And tracking is enabled with a separate method call while installing SDK. All information attached to the events are optional, so it can also be used without an attachment. Nonetheless, more information on events can translate into detailed and accurate statistical analysis (e.g. remarketing campaign, DSP integration). Therefore, it is advised that people send this information.

  1. Sign Up
  2. Sign In
  3. Home View
  4. Product Instance
  5. Product List View
  6. Search Result View
  7. Product Details View
  8. Add to Cart
  9. Purchase
  10. Sign Out

Sign Up

To track in-app events during sign up, please call signUp while users are signing up. You can create user instance with calling makeUserObject.

makeUserObject: function(user) {
    return {
        userId: user['userId'] || '',
        userEmail: user['userEmail'] || ''
    };
}

Code Example :

_user = AirbridgeApi.makeUserObject({action: 'testAction', userId: 'UserAB'});
AirbridgeApi.signUp(_user);
  • When calling this method, we strongly recommend that you configure at least one value between UserID and UserEmail for effective data analysis.
  • Once this method is called, all values for user information will be hashed (SHA256) for it to be sent and managed.
  • For UserID and UserEmail for internal use, this method will retrieve that value again from S3 in a csv format (externalUserID, externalUserEmail), so that funnel and/or attributed path as well as integration of identified user’s data can be confirmed. Also, this value can be used to send server-to-server in-app events and for matching cross-platform users.

Sign In

To track in-app events during sign-in, please call signIn while users are signing in. You can create user instance with calling makeUserObject.

makeUserObject: function(user) {
    return {
        userId: user['userId'] || '',
        userEmail: user['userEmail'] || ''
    };
}

Code Example :

_user = AirbridgeApi.makeUserObject({action: 'testAction', userId: 'UserAB'});
AirbridgeApi.signIn(_user);
  • When calling this method, we strongly recommend configuring at least one value between UserID and UserEmail for effective data analysis.
  • Once this method is called, all values for user information will be hashed (SHA256) to be sent and managed.
  • For UserID and UserEmail for internal use, this method will retrieve that value again from S3 in csv format (externalUserID, externalUserEmail), so that funnel and/or attributed path as well as integration of identified user’s data can be confirmed. Also, this value can be used to send server-to-server in-app events and for matching cross-platform users.

Home View

To track in-app events looking up for home view, please call AirbridgeApi.sendViewHome while users are in home view.

Code Example :

AirbridgeApi.sendViewHome();

Create Product Instance

To track info related product, please create instance including product information via calling makeProduct. Product instance that were created, it can be used for 'product list views', 'search result view', 'product details page view', 'add to cart' and 'purchase'.

makeProduct: function(product) {
    return {
        productId: product['productId'] || '',
        name: product['name'] || '',
        currency: product['currency'] || 'KRW',
        price: product['price'] || 0,
        quantity: product['quantity'] || 0,
        positionInList: product['positionInList'] || 0
    };
}
...
_product = AirbridgeApi.makeProduct({productId: '1', price: 100},
_products = [AirbridgeApi.makeProduct({productId: '1', price: 100})]
Variable Type Details
productId (recommend) String Product’s unique ID. It is a recommended value for DSP integration.
name String Product name
currency String We follow currency information (ex. KRW) according to ISO 4217 standard
※ This value will later be added to the total amount of purchase for multinational servicing in future.
price int Price of item
quantity int Quantity of items purchased
positionInList int Actual position of the product from the list
※ It is used to reflect search result and priority information that are displayed to users from the product list.

Code Example :

_products = [AirbridgeApi.makeProduct({productId: '1', price: 100}), AirbridgeApi.makeProduct({productId: '2', quantity: 3})];
AirbridgeApi.sendCompleteOrder(_products, 'Transaction-123', true, 'KRW', 10000);

Product List View

To track in-app events during product list views, please call AirbridgeApi.sendViewProductList while users are looking up the list of products.

Code Example :

_products = [AirbridgeApi.makeProduct({productId: '1', price: 100}), AirbridgeApi.makeProduct({productId: '2', quantity: 3})];
AirbridgeApi.sendViewProductList('ListID-123', _products);
  • When users load new information through scrolling the list, we recommend that you send product information additionally loaded via that new event.
  • In case sent list of products to events do not match user’s viewed list, we recommend that you send an actual list order of products looked up by users via setPositionInList method of Product class. This information will be used to process ranking for products.
  • For more information on Product class, kindly refer to details below.

Search Result View

To track in-app events during product details page view, please call AirbridgeApi.sendViewSearchResult while users are looking up for product details.

Code Example :

_products = [AirbridgeApi.makeProduct({productId: '1', price: 100}), AirbridgeApi.makeProduct({productId: '2', quantity: 3})];
AirbridgeApi.sendViewSearchResult('Query-123', _products);

For more information on Product Instance, kindly refer to Create Product Instance.

Product Details View

To track in-app events during product details page view, please send AirbridgeApi.sendViewProductDetail while users are looking up for product details.

Code Example :

AirbridgeApi.sendViewProductDetail(AirbridgeApi.makeProduct({productId: '1', currency: 'KRW', price: 100}));

For more information on Product Instance, kindly refer to Create Product Instance.

Add to Cart

To track in-app events during add-to-cart, please call AirbridgeApi.sendAddToCart while users are adding products to cart.

Code Example for ‘Campaign Attribution Analytics’ (for simple ROI measurement) :

AirbridgeApi.sendAddToCart(AirbridgeApi.makeProduct({productId: '1', currency: 'KRW', price: 100}),
cartId='Cart-123', currency='KRW', totalValue=10000);

For more information on Product Instance, kindly refer to Create Product Instance.

Purchase

To track in-app events during purchase, please call AirbridgeApi.sendCompleteOrder while users are completing order.

Code Example for ‘Campaign Attribution Analytics’ (for simple ROI measurement) :

_products = [AirbridgeApi.makeProduct({productId: '1', price: 100}), AirbridgeApi.makeProduct({productId: '2', quantity: 3})];
AirbridgeApi.sendCompleteOrder(_products, 'Transaction-123', true, 'KRW', 10000);

For more information on Product Instance, kindly refer to Create Product Instance.

Sign Out

To track in-app events during sign out, please call AirbridgeApi.expireUser() when users are signing out.

Method Type Details
expireUser void Logout event action

Code Example :

AirbridgeApi.expireUser();

Configuring Custom In-app Events

When dynamically calling method on SDK for desired in-app event, the result data could be viewed on Dashboard after at least one calling.

Variable Type Details
category String Event category
label String Event label
action String Event action
value int Event value

Code Example :

AirbridgeApi.goal('category', 'action', 'label', 100);

For more information on Category, Action, and Label, kindly refer to details as below.

In-app Events Grouping with Category / Action / Label

Airbridge offers in-app statistics based on a combination of three separate values: Category, Action, and Label. With default in-app event, the Category is pre-fixed so that values of Action and Label can be used freely. Also, there are four default in-app events capable of combining separated values: “Sign Up”, “Sign In”, “Add to Cart”, and “Purchase”. Customized statistical reports can make use of all three separate values of Category, Action, and Label. The following are real use cases.

  1. (Default) Category : Sign In (fixed) / Action : “Seoul” / Label : “Male”
  2. (Default) Category : Sign In (fixed) / Action : “Busan” / Label : “Female”
  3. (Default) Category : Purchase (fixed) / Action : “Use discount coupon” / Label : “Use Kakao Pay”
  4. (Custom) Category : “user-subscription-canceled” / Action : “premium” / Label : null

Combining too many Actions and Labels can delay real-time statistical reporting. Hence we strongly recommend to use the combination of a maximum number of 10,000 or below including all in-app events.

To Configure Deep Link

To Prepare Integration

To integrate, Custom URI Scheme (ex. your-app-name://) from the existing app should be registered to Airbridge Dashboard.

Once registered, a deep link with JavaScript branching logic is activated so that marketers can submit path and query string parameters on deep links as they create tracking links on Dashboard (Please note that the integration must include at least one of the two: Custom URI Scheme or SHA256 fingerprint.).

Airbridge supports a deep link integration with Android Applinks.

Once Android Applinks are integrated, a deep link with HTTPS branching logic is activated so that marketers can submit path and query string parameters on deep links as they create tracking links on Dashboard (Please note that the integration must include at least one of the two: Custom URI Scheme or SHA256 fingerprint). The integration process is as follows.

To Add URI Mapping to AndroidManifest.xml

Please register the intent filter to the linked Activity via Airbridge deep link with the following details. YOUR_APP_NAME must be edited with the app name as registered on Airbridge Dashboard.

<activity android:name=".ContentActivity" >
     <intent-filter android:autoVerify="true">
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />

         <data android:scheme="YOUR_APP_NAME" />
         <data android:host="airbridge.io.deeplink" />
     </intent-filter>
</activity>

To Register of SHA256 Fingerprint on Airbridge Dashboard

To enable deep link, first the SHA256 fingerprint from app’s signed key must be registered. Through Android's Digital Asset Links Verification, this information will be used to determine credible app links.

platform information to be retrieved example of corresponding value
android
(App Links)
https 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5

*To Register Released Key *
When distributing the app, released key’s extension, .jks, will be used for signature. This released key must be registered with the same procedure.

When using Google Play App Signing, signature is changed while APK is uploaded to the store. Therefore, that corresponding key must be registered as well.

After calling this command, copy SHA256 to register on Airbridge Dashboard > Deep Link Setting > SHA256 Fingerprint.

keytool -list -v -keystore my-release-key.keystore

Once Airbridge Dashboard registration is completed, you can visit Digital Asset Links Tester to check with registered information (Hosting Site Domain : YOURAPPNAME.airbridge.io).

※ Attention: Airbridge currently supports registration of a single entry of the fingerprint via Android Applinks support. This function will be expanded to multiple fingerprints later while we momentarily support a released key registration.

To track deep link execution on Airbridge, codes must be added to the deep link handler.

AirbridgeApi.deeplinkLaunched('http://deeplink?q=123');

To receive deep links from Facebook, Facebook’s delayed deep link function should be disabled. Please do not call AppLinkData.fetchDeferredAppLinkData method for this. For more details on code levels, kindly refer to the link.

To Configure Custom Android App Time Duration

This guide will help you to make custom settings for app time duration on Android.

Default Value

On Airbridge Android, default app time duration is 300 seconds (5 min).

To Configure Custom App Time Duration

On Airbridge Android, app time duration can be adjusted to user’s needs.

Before calling AirBridge.init (initializing Airbridge), the following method can be called to adjust app time duration.

AirbridgeApi.setCustomSessionTimeOut(100);
...
AirbridgeApi.init('[app name]', '[app token]');
...

The setting period must be an integer, with a base unit of s (sec) that is no less than 0, and with a maximum value of 604,800 (7 days).

To Integrate Google Play Install Referrer API(for fraud prevention)

This is a guide to integrate Google Play Install Referrer API on Android.

Configuration Setting

Please add Google Play Install Referrer API library to app’s build.gradle file as follows. With a line break, integration with Google Play Install Referrer API will be completed.

dependencies {
    ...
    compile 'com.android.installreferrer:installreferrer:1.0'
}
Search Results
keyboard_return Back