menu User Guide
개발자 가이드 chevron_right SDK 설치
iOS SDK
Airbridge iOS SDK must be integrated to track install, launch, in-app event, and retention of an iOS app via Airbridge service.

Agreement to Terms and Conditions on Advertising Identifier (IDFA)

To publish an app on App Store to track Airbridge iOS SDK install Advertising Identifier (IDFA), you must agree to its terms and conditions. The ad identifier is solely used as an unique ID to user install tracking, not for other uses such as personal information matching. Airbridge complies with the contents to Apple Program License Agreement.

  1. When you publish an app on App Store, check ‘Yes’ to the Advertising Identifier item.
  2. Also, please check the following two items: 'Attribute this app installation to a previously served advertisement.', and 'Limit Ad Tracking Setting in iOS'.

Quick Install and Setting

Quick Install

There are two ways to install tracking links under iOS support: using Cocoapods and downloading Framework. Cocoapods is a management tool which automates and simplifies the compatibility of iOS third-party libraries, which allows an automatic install and control of SDK. Therefore, we strongly recommend the use of Cocoapods than Framework, which requires a manual download and install.

To Install with Cocoapods

Please set up the podfile as follows.

pod 'AirBridge'

To Install Framework via Download

Visit this link to download Framework manually and drag-and-drop the file to the project.

.Zip file MD5 Checksum: 5619939eab9ed4cb8b4d4e0b67c43565

Because the framework is written in Objective-C language, a Bridging Header File must be added for use, for all the projects with Swift.

  1. [Command + N] or navigate to [File > New > File...] > iOS - Source > Header File.
  2. Save project name in <YOUR_PROJECT_NAME>-Bridging-Header.h format.
  3. Add #import <AirBridge/AirBridge.h> to Header File.
  4. Add /PATH/TO/<YOUR_PROJECT_NAME>-Bridging-Header.h to Objective-C Bridging Header which is under Build Settings.

Quick Settings

Please insert the following code to didFinishLaunchingWithOptions method to the app’s appdelegate class.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  /.../
  [AirBridge getInstance:<"YOUR_APP_TOKEN(app token)"> appName:<"YOUR_APP_NAME(app name)"> withLaunchOptions:launchOptions facebookSDKInstalled:NO];
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    /.../
    AirBridge.getInstance(<"YOUR_APP_TOKEN(app token)">, appName:<"YOUR_APP_NAME(app name)">, withLaunchOptions:launchOptions, facebookSDKInstalled:false)
    return true
}

'app name' and 'app token' can be checked by navigating Dashboard ('app information > app basic information'. For more details, please refer to Guide.

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 iOS SDK install, as details below.

// ...
[[AirBridge instance] setUser:@"test-user-id"];               
[[AirBridge instance] setEmail:@"test-email@foo.com"];   
// ...
  • When calling this method, we strongly recommend that you configure at least one value between UserID and UserEmail for an integrated analytics across web, mobile, and offline platforms.
  • 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 be used for matching cross-platform users.

To Configure Default In-app Events

After installing app, 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 looked up features such as “sign up”, “sign in”, “home view”, “product list view”, “search result view”, “product details view”, “add to cart”, and “purchase” will be offered with a separated method as a default in-app event. Also, for customized in-app events, when methods are dynamically called from SDK, it could be found from Dashboard once a single action is executed.

Airbridge basically supports a sum of 8 default in-app events. And tracking can be enabled with a separate method calling while installing SDK. All information attached to the events are optional, so it can 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 recommended that people send this information.

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

Sign Up

To track in-app events during sign up, please send sendSignup while users are signing up.

Method Type Descrioption
sendSignup NSString, NSString User Email
#import <AirBridge/ABUserEvent.h>

ABUser *user = [[ABUser alloc] init];
user.userEmail = @"donutt@ab180.co";
user.userID = @"donutt@ab180.co";
ABUserEvent *userEvent = [[ABUserEvent alloc] initWithUser:user];
[userEvent sendSignup];
  • When calling this method, we strongly recommend that you configure at least one value between UserID and UserEmail for an integrated analytics across web, mobile, and offline platforms.
  • 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 be used for matching cross-platform users.

Sign In

To track in-app events during sign-in, please send sendSignin while users are signing in.

Method Type Description
sendSignup NSString User Email
#import <AirBridge/ABUserEvent.h>

ABUser *user = [[ABUser alloc] init];
user.userEmail = @"donutt@ab180.co";
user.userID = @"donutt@ab180.co";
ABUserEvent *userEvent = [[ABUserEvent alloc] initWithUser:user];
[userEvent sendSignin];
  • When calling this method, we strongly recommend that you configure at least one value between UserID and UserEmail for an integrated analytics across web, mobile, and offline platforms.
  • 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 be used for matching cross-platform users.

Home View

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

Method Type Description
sendViewHome - Home View Event

Product List View

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

Method Field Name Type Detailed Parameter Field Name Type Detailed Parameter Description
sendViewProductLis products Array<Product>
idx NSString Product ID
name NSString Product Name
price NSNumber Product Price
currency NSString Product Currency
orderPosition NSNumber Product Order Position
#import <AirBridge/ABEcommerceEvent.h>

ABProduct *product1 = [[ABProduct alloc] init];
product1.idx = @"idx1";
product1.name = @"name1";
product1.price = @100;
product1.currency = @"USD";
product1.orderPosition = @1;

ABProduct *product2 = [[ABProduct alloc] init];
product2.idx = @"idx2";
product2.name = @"name2";
product2.price = @200;
product2.currency = @"USD";
product2.orderPosition = @2;

ABEcommerceEvent *ecommerceEvent = [[ABEcommerceEvent alloc] initWithProducts:@[product1, product2]];

[ecommerceEvent sendViewProductList]

Search Result View

To track in-app events while looking up for search results please send sendViewSearchResult while users are searching for products.

Method Field Name Type Detailed Parameter Field Name Type Detailed Parameter Description
searchResultViewEvent query NString - - Search Query
product NSArray<Product>
idx NSString Product ID
name NSString Product Name
price NSNumber Product Price
currency NSString Product Currency
orderPosition NSNumber Product Order Position
#import <AirBridge/ABEcommerceEvent.h>

ABProduct *product1 = [[ABProduct alloc] init];
product1.idx = @"idx1";
product1.name = @"name1";
product1.price = @100;
product1.currency = @"USD";
product1.orderPosition = @1;

ABProduct *product2 = [[ABProduct alloc] init];
product2.idx = @"idx2";
product2.name = @"name2";
product2.price = @200;
product2.currency = @"USD";
product2.orderPosition = @2;

ABEcommerceEvent *ecommerceEvent = [[ABEcommerceEvent alloc] initWithProducts:@[product1, product2]];

ecommerceEvent.query = @"query";
[ecommerceEvent sendViewSearchResult];

Product Details View

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

Method Field Name Type Detailed Parameter Field Name Type Detailed Parameter Description
sendViewProductDetail product NSArray<Product>
idx NSString Product ID
name NSString Product Name
price NSNumber Product Price
currency NSString Product Currency
orderPosition NSNumber Product Order Position
#import <AirBridge/ABEcommerceEvent.h>

ABProduct *product1 = [[ABProduct alloc] init];
product1.idx = @"idx1";
product1.name = @"name1";
product1.price = @100;
product1.currency = @"USD";
product1.orderPosition = @1;

ABProduct *product2 = [[ABProduct alloc] init];
product2.idx = @"idx2";
product2.name = @"name2";
product2.price = @200;
product2.currency = @"USD";
product2.orderPosition = @2;

ABEcommerceEvent *ecommerceEvent = [[ABEcommerceEvent alloc] initWithProducts:@[product1, product2]];
[ecommerceEvent sendViewProductDetail];

Add to Cart

To track in-app events during add-to-cart, please send sendAddProductToCart while users are adding products to cart.

Method Field Name Type Detailed Parameter Field Name Type Detailed Parameter Description
sendAddProductToCart cartId Numbers - - Product Cart ID
totalValue Numbers - - Product Total Value
currency Strings - - Product Currency
product Array<Product>
productID Numbers Product ID
name Strings Product Name
price NSNumber Product Price
currency NSString Product Currency
quantity NSNumber Product Quantity
#import <AirBridge/ABEcommerceEvent.h>

ABProduct *product1 = [[ABProduct alloc] init];
product1.price = @100;
product1.currency = @"USD";
product1.quantity = @3;

ABEcommerceEvent *ecommerceEvent = [[ABEcommerceEvent alloc] initWithProducts:@[product1]];

[ecommerceEvent sendAddProductToCart];

Purchase

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

Method Field Name Type Detailed Parameter Field Name Type Detailed Parameter Description
sendCompleteOrder isInAppPurchase BOOL - - In App Purchase
eventValue NSNumbers - - Product Total Value
currency NSString - - Product Currency
transactionID NSNumber - - Product Transaction ID
products Array<Product>
price NSNumber Product Price
currency NSString Product Currency
#import <AirBridge/ABEcommerceEvent.h>

ABProduct *product1 = [[ABProduct alloc] init];
product1.price = @100;
product1.currency = @"USD";

ABEcommerceEvent *ecommerceEvent = [[ABEcommerceEvent alloc] initWithProducts:@[product1]];
ecommerceEvent.isInAppPurchase = NO;
ecommerceEvent.transactionID = @"123456789"
ecommerceEvent.eventValue = [NSNumber numberWithInt:100];
[ecommerceEvent sendCompleteOrder];

Sign Out

To track in-app events during sign out, please send 'expireUser' when users are signing out.

Method Type Description
expireUser void Signout Event Action
#import <AirBridge/ABUserEvent.h>

ABUserEvent *userEvent = [[ABUserEvent alloc] init];
[userEvent expireuser];

To Configure Custom In-app Events

If you are a Premium user, when the goal of in-app event is reached with identified in-app event types, please call the method as follows.

Method Type Description
goalWithCategory NSString Custom Event including Identifier in App Event
// ...
[[AirBridge instance] goalWithCategory:@"In-app Event Type"];
// ...

In-app Event Grouping with Category / Action / Label

Airbridge basically offers in-app statistics based on a combination of three separate values: Category, Action, and Label. As for 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 which are capable of combining separate values:“Sign Up”, “Sign In”, “Add to Cart”, and “Purchase”. Customized statistical reporting can make use of all three separated 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.

On mobile SDK, please call method as follows when the goal of in-app event is reached, including all of the aforementioned values.

[[AirBridge instance] goalWithCategory:(String Type) // Type of Goal Category                         
            action:(String Type) // Action
            label:(String Type) // Label
            value:(Number Type) // Value
            customAttributes:(Dictionary Type)]; // Others

To Configure Deep Link

To Prepare Integration

According to Apple Developer Guide(upper iOS 9.2)

Apple has provide new guideline for deeplink from iOS 9.2. So, iOS developer should check and build up by following the new guide line of Apple Inc.

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

(You can find currently registered Custom URI Scheme under ‘Info’ tab of Xcode.)

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 appID.).

Airbridge supports deep link integration with Universal Link branching logic. On iOS Safari browser, the Universal Link allows users move into the app by clicking on an authorized link authenticated with HTTPS protocol. When the app is uninstalled, it can help sending the users to a pre-destined Fallback link.

Once the Universal Link is 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 appID). The integration is processed as follows.

  1. Add YOURAPPNAME.airbridge.io domain to Xcode Setting
    Airbridge’s tracking link follows this format https://YOURAPPNAME.airbridge.io. Therefore, users will first have to add “applinks:YOURAPPNAME.airbridge.io” to ‘Associated Domains’ section under Xcode’s ‘Capabilities’ tab. (YOURAPPNAME(app name) can be found from 'app information > app basic information')

  1. Registration of appID on Airbridge Dashboard
    Also, users are requested to register appID on Airbridge Dashboard. Here, the appID is a product of team ID and/or a combined value of app ID prefix with a bundle ID. This value can be identified by navigating Certificates, Identifiers & Profiles > Identifiers > App IDs at the Apple Developer website. (Link)
platform name of input value example of corresponding value
iOS
(Universal Link)
appID 9JA89QQLNQ.com.apple.wwdc

For example, the above screenshot image reveals that appID is a combined value of Prefix and ID with a separator ‘.’. Please insert this appID to Airbridge Dashboard > Deep Link Setting > iOS appID section.

Once registration on Airbridge Dashboard is completed, you can visit the link like http://YOURAPPNAME.airbridge.io/.well-known/apple-app-site-association to test if all the information is safely saved for Universal Link integration (Please enter your app name to ‘YOURAPPNAME’).

Airbridge supports an additional code to the existing handler. It is named as ‘Adding Code Snippet of Airbridge to Original Own Handler’ and it tracks deep link execution. In this case, users must remember to add both of the delegates to the setting: Custom URI scheme and Universal Links.

To Add Code Snippet of Airbridge to Original Own Handler

Please call the following method to the existing delegate of deep link handler.

     [[AirBridge instance] handleURL:url];

     [[AirBridge instance] registDefaultRoutingCallback:^(NSString *routing, NSDictionary *params, NSError *error) {

        }];

Here are real usages in code.

Custom URI Delegate ( For supporting upper iOS 9.0 )

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
     //set deeplink
     [[AirBridge instance] handleURL:url];

     //url parameters handling
    [[AirBridge instance] registDefaultRoutingCallback:^(NSString *routing, NSDictionary *params, NSError *error) {

            NSString * value1 = params[@"key1"];
            NSString * value2 = params[@"key2"];
        }];

    return YES;
}

Custom URI Delegate ( For supporting under iOS 9.0 )

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

     //set deeplink
     [[AirBridge instance] handleURL:url];

     //url parameters handling
    [[AirBridge instance] registDefaultRoutingCallback:^(NSString *routing, NSDictionary *params, NSError *error) {

            NSString * value1 = params[@"key1"];
            NSString * value2 = params[@"key2"];
        }];

    return YES;
  }
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
     //set deeplink
<<<<<<< HEAD
    [[ABRouting instance] fireRoute:userActivity.webpageURL];
     [[AirBridge instance]setDeeplink:userActivity.webpageURL];

=======
     [[AirBridge instance] handleURL:userActivity.webpageURL];

>>>>>>> af96081be2009ac632bba88ed06e150f267839b8
     //url parameters handling
    [[AirBridge instance] registDefaultRoutingCallback:^(NSString *routing, NSDictionary *params, NSError *error) {

            NSString * value1 = params[@"key1"];
            NSString * value2 = params[@"key2"];
        }];

    return YES;
}

To receive deep links from Facebook, Facebook’s delayed deep link function should be disabled. Do not use fetchDeferredAppLink: method from FBSDKAppLinkUtility. Instead, please use Airbridge handler. For more details on code levels, kindly refer to the [link]((https://docs.airbridge.io/en/marketerguide/2-2-5.html#facebooksdk_caution).

To Configure Deferred Deep Linking

Deferred Deep Linking is a function offered by tracking links, where a random Query String (e.g. http://abr.ge/?campaign=facebook&value=100), inclusive of 5 marketing intensive attribute values, is redirected to a pre-destined CallBack handler (specific page to the app) as the app launches.

For instance, a user who installed app via a tracking link to specific promotion can be directed to the corresponding promotion page after install. This consistency found across user experience helps to prevent early stage app exits.

To support ‘Deferred Deep Linking’, please setup deep link install CallBack with SDK Initialization code, which can be found from appdelegate class. Kindly refer to the details as below.

To Configure Deep Link Install CallBack

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //delivery custom parameter CallBack when deffered deeplinik.
    [[AirBridge instance] registSimpleLinkRoutingCallback:^(NSString *routing, NSDictionary *params, NSError *error) {

        NSString *campaignFromWeb = [params valueForKey:@"campaign"];
        NSString *valueFromWeb = [params valueForKey:@"value"];
        //... insert logics as you wish ...
    }];
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    //delivery custom parameter CallBack when deffered deeplinik.
    AirBridge.instance().registSimpleLinkRoutingCallback { (routing:String!, params:[NSObject: AnyObject]!, error: NSError!) -> Void in
        let campaignFromWeb = params["campaign"];
        let valueFromWeb = params["value"];
        //... insert logics as you wish ...
    }

}

To Configure iOS Custom App Session Time Duration

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

Default Value

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

To Configure App Session Time Duration

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

[[AirBridge instance] setCustomSessionTimeOut:(NSInteger) value];

The period must be configured in 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 Configure Flag for Collected Information with iOS WIFI Scanning (for Offline Data Analytics)

This is a guide to flag setting for collected information with WIFI scanning on iOS.

Default Value

The default value is ‘false’ for flags with collected information with WIFI scanning on Airbridge iOS.

To Configure On/Off for Collected Information with WIFI Scanning

On Airbridge iOS, collected information with WIFI Scanning can be set on/off according to user’s needs.

[[AirBridge instance] setWifiInfoUsability:(BOOL) value];

The value can either be set true or false, depending on user needs.

To Test SDK Execution

As of now, Airbridge strongly recommends the creation of a random link to test installs and goal events, and also to remove them. SDK Execution Testing is divided into two parts: before and after distribution on Apple App Store.

Before Distribution on Apple App Store

Before distribution on Apple App Store, the following testings can be conducted to determine if SDK will be working.

  1. Before testing, you must delete the app on device.
  2. Create a random tracking link from Airbridge Analytics.
  3. Execute the tracking link on target device, and see if it moves to Apple App Store.
  4. Build the app with development tool, install on target device, and launch the app.
  5. If SDK was installed with success, you will be able to see the number of installs increase for the tracked link from 'Tracking Links Statistics' page. If the number of installs remains unchanged, please visit [Guide on SDK Install] again.

After Distribution on Apple App Store

After distribution on Apple App Store, the following testings can be conducted to determine if SDK will be working.

  1. Create a random tracking link from Airbridge Analytics.
  2. Execute the tracking link on target device, and see if it moves to Apple App Store.
  3. If SDK was installed with success, you will be able to see the number of installs increase for the tracked link from 'Tracking Links Statistics' page. If the number of installs remains unchanged, please visit [Guide on SDK Install] again.

New Changes from iOS SDK v1.x Upgrade


V 1.0.5 - 2017.10.18

  1. When the status of app changes from background to foreground, foreground events will now be sent to Airbridge System.
  2. When purchase events are sent, transactionIDs will be included to the delivery.

V 1.0.0 - 2017.09.13

To existing Airbridge SDK users, kindly refer to the changes below.

New Changes to SDK Initialization

To bolster our security system, we no longer use existing SDK UserToken and App ID, which is written in numerical form. Instead, we have adopted a newly released ‘App Token’, with the ‘app name’ which users entered during app registration.

  • Before: AirBridge* getInstance:(NSString *)userToken appToken:(NSString *)appToken
    (The AppToken here is written in ‘numerical’ forms, before encryption has been made. Please DO NOT use this to newly changed AppToken.)
  • Change: AirBridge* getInstance:(NSString *)appToken appName:(NSString *)appName

The newly changed values can be checked from 'app information > app basic information' on Dashboard. If these changes are not saved, statistical data after install cannot be offered, as Throw Exceptions will be raised. Please save settings after changes are made.

New Changes to Default In-app Events

Along with official distribution of version 1.0.0, new default goal has been set along with little changes to sign-up and sign-in events. We have minimized instance dependency to the fullest, and created a new Event Module which allow users can freely do coding.

New Changes to Custom In-app Event Method Towards an advanced in-app event tracking service with value, we have changed in-method parameter and changed method names in a intuitive manner. In this regard, you can put parameter value, which you previously used with goalDescription, to category.

  • Before: BOOL simpleGoalWithDescription:(NSString *)goalDescription
  • Change: BOOL goalWithCategory:(NSString *)category

Please apply in-app event type for category.

In-app event type can be checked by navigating ‘In-app Event Management’ on Airbridge Dashboard.

Search Results
keyboard_return Back