Cordova-Ionic SDK

    NPM Version

    Note

    This is a guide for installing and setting up the Cordova-Ionic SDK v4. For previous versions, refer to the Cordova-Ionic SDK (Previous) guide.

    Install the Airbridge Cordova-Ionic SDK and implement the necessary settings following the steps below.

    Install SDK

    The Airbridge Cordova-Ionic SDK can be installed using the method below. After installation, you can verify whether the SDK has been properly installed through a Cordova-Ionic SDK Test.

    Install the airbridge-cordova-sdk plugin for each platform.

    1
    cordova plugin add airbridge-cordova-sdk
    1
    ionic cordova plugin add airbridge-cordova-sdk

    Initialize SDK

    The initialization methods for iOS and Android SDKs are different. Refer to the information below. The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.

    iOS

    Add the following code to the application:didFinishLaunchingWithOptions: function in the ios/[project name]/AppDelegate.m file.

    1234
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        AirbridgeCordova.initializeSDK(name:"YOUR_APP_NAME", token:"YOUR_APP_TOKEN")
        ...
    }
    1234
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        [AirbridgeCordova initializeSDKWithName:@"YOUR_APP_NAME" token:@"YOUR_APP_TOKEN"];
        ...
    }

    Android

    The Android SDK is initialized within the Android Application class.

    1. Create an Application class and add a file within the platforms/android/app/src/main/java/[PACKAGE NAME]/MainApplication.java. If you already have an Application class, move to step 3.

    2. Set the generated Application in AndroidManifest.xml.

    AndroidManifest.xml
    123
     <application
            android:name=".AndroidApplication"
            ...>

    3. Add the following code to the platforms/android/app/src/main/java/[PACKAGE NAME]/MainApplication.java file.

    1234567
    import co.ab180.airbridge.cordova.AirbridgeCordova
    ...
    override fun onCreate() {
        super.onCreate()
        AirbridgeCordova.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
        ...
    }
    12345678
    import co.ab180.airbridge.cordova.AirbridgeCordova;
    ...
    @Override
    public void onCreate() {
        super.onCreate();
        AirbridgeCordova.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
        ...
    }

    Configure SDK settings

    Configure the SDK settings to use the Airbridge Cordova-Ionic SDK.

    1234567891011121314151617181920
    {
        "sdkEnabled": boolean,
        "logLevel": "debug" | "info" | "warning" | "error" | "fault",
        "autoStartTrackingEnabled": boolean,
        "autoDetermineTrackingAuthorizationTimeoutInSecond": number,
        "trackMetaDeferredAppLinkEnabled": boolean,
        "sessionTimeoutInSecond": number,
        "metaInstallReferrerAppID": string,
        "trackAirbridgeDeeplinkOnlyEnabled": boolean,
        "trackingLinkCustomDomains": [string],
        "hashUserInformationEnabled": boolean,
        "sdkSignatureID": string,
        "sdkSignatureSecret": string,
        "clearEventBufferOnInitializeEnabled": boolean,
        "eventBufferCountLimit": number,
        "eventBufferSizeLimitInGibibyte": number,
        "eventTransmitIntervalInSecond": number,
        "isHandleAirbridgeDeeplinkOnly": boolean,
        "collectTCFDataEnabled": boolean
    }

    1. Create an airbridge.json file at the top level of the Cordova-Ionic project folder, input the JSON as above, and configure the SDK settings.

    2. Don't input values for keys that are not necessary for your service.

    Refer to the links below for detailed guidance on the individual key values.

    Key Value

    Reference

    sdkEnabled

    Initialize the Airbridge SDK with all functions disabled

    logLevel

    SDK logs

    autoStartTrackingEnabled

    Opt-in setup

    Opt-out setup

    autoDetermineTrackingAuthorizationTimeoutInSecond

    Configure ATT prompt

    trackMetaDeferredAppLinkEnabled

    Set up Meta deferred app links

    sessionTimeoutInSecond

    Configure in-app event sessions

    metaInstallReferrerAppID

    Set up Meta Install Referrer collection

    trackAirbridgeDeeplinkOnlyEnabled

    Track only Airbridge Deep Links

    hashUserInformationEnabled

    Hash user information

    sdkSignatureID

    SDK Signature

    sdkSignatureSecret

    SDK Signature

    clearEventBufferOnInitializeEnabled

    Clear unsent in-app events

    eventBufferCountLimit

    Configure in-app event storage

    eventBufferSizeLimitInGibibyte

    Configure in-app event storage

    eventTransmitIntervalInSecond

    Configure in-app event transmission frequency

    isHandleAirbridgeDeeplinkOnly

    Receive Airbridge Deep Links only

    collectTCFDataEnabled

    Compliance with Google DMA

    Configure ATT prompt

    Note

    The functions necessary to ensure compliance with privacy policies should be reviewed with legal counsel.

    In the iOS environment, the IDFA can only be collected when users provide consent for data tracking through the App Tracking Transparency (ATT) prompt.

    Event collection should be delayed until the user allows tracking. If the install event is collected before the user allows tracking through the ATT prompt, the install event data will lack an identifier, making performance measurement difficult. We recommend setting a sufficient delay time for event collection to collect identifiers.

    1. Prepare the text you will use in the ATT prompt.

    2. Provide the ATT prompt following this guide provided by Apple.

    3. If the install event is not collected, the Airbridge Flutter SDK delays collecting install events for 30 seconds until the user allows tracking each time the app is launched. If the user exits the app before deciding whether to allow tracking, the SDK will not collect the install event and will try again at the next app launch.

    In the SDK settings, configure autoDetermineTrackingAuthorizationTimeout to set a sufficient delay time for collecting install events. The default value is 30 seconds, and it can be set up to 3600 seconds (1 hour).

    Attention

    Set a sufficient delay time to collect the app install event. If the SDK collects install events before users can allow tracking on the ATT prompt, the IDFA won't be collected along with the install events.

    Opt-in setup

    Attention

    Optional settings. Configure only if necessary.

    The opt-in policy requires user consent before using user data.

    In the SDK settings, set autoStartTrackingEnabled to false , and call the startTracking function at the time when you can collect events. The SDK will start collecting events when the startTracking function is called.

    1
    Airbridge.startTracking()

    Opt-out setup

    Attention

    Optional settings. Configure only if necessary.

    The opt-out policy allows the use of user information until the user explicitly declines.

    In the SDK settings, set autoStartTrackingEnabled to true , and call the stopTracking function at the time when you can no longer collect events. The SDK will stop collecting events when the stopTracking function is called.

    1
    Airbridge.stopTracking()

    SDK Signature

    Attention

    Optional settings. Configure only if necessary.

    With the SDK Signature, you can prevent SDK spoofing and use verified events to measure ad performance.

    The SDK Signature credentials, which are the Secret ID and the Secret, are required for the SDK Signature setup. They can be found on the [Management]>[Fraud Validation Rules]>[SDK Signature] page in the Airbridge dashboard. For more details on how to find the SDK Signature credentials, refer to this Airbridge guide.

    Once you have the credentials, go to the SDK settings and enter the Secret ID as sdkSignatureID and the Secret as sdkSignatureSecret.

    Deep Linking

    Deep linking allows you to redirect users from ads to specific locations within your app. The data collected from the tracking link enables you to monitor the performance of the deep link in Airbridge.

    When a user clicks on the Airbridge tracking link, the scheme deep link embedded in the tracking link is converted into an Airbridge Deep Link, which can be either an HTTP deep link or a scheme deep link. This Airbridge Deep Link redirects the user to the desired app location. Then, the Airbridge SDK converts the Airbridge Deep Link back to the original scheme deep link embedded in the tracking link and passes it to the app.

    • Example scheme deep link embedded in the tracking link: YOUR_SCHEME://product/12345

    • Examples of Airbridge Deep Links

      • HTTP deep link format 1: https://YOUR_APP_NAME.airbridge.io/~~~

      • HTTP deep link format 2: https://YOUR_APP_NAME.abr.ge/~~~

      • Scheme deep link format: YOUR_SCHEME://product/12345?airbridge_referrer=~~~

    When the app is installed on the device and the tracking link is clicked, the app opens through the Airbridge Deep Link. The Airbridge SDK converts the Airbridge Deep Link into the scheme deep embedded in the tracking link and passes it to the app.

    When the app is not installed on the device and the tracking link is clicked, the Airbridge SDK saves the Airbridge Deep Link. After the user is redirected to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge Deep Link into the scheme deep link embedded in the tracking link and passes it to the app.

    Set up deep linking

    For the deep linking setup, the following information is required.

    • Deep link information submitted in the Airbridge dashboard

    • In-app location address for user redirection

    First, submit the deep link information to the Airbridge dashboard.

    For the deep linking setup, the following information must be entered into the Airbridge dashboard.

    iOS

    • iOS URI scheme: The Airbridge Deep Link is converted to a scheme deep link using the iOS URI scheme.

    • iOS App ID: The universal link domain of the Airbridge Deep Link is set using the iOS App ID.

    Android

    • Android URI scheme: The Airbridge deep link is converted to a scheme deep link using the Android URI scheme. This information is necessary for the App Link and URI scheme.

    • Package name: This is the Android app identifier necessary for the App Link and URI scheme.

    • Android sha256_cert_fingerprints: This is used for setting the App Link domain. This information is necessary for the App Link.

    Attention

    To properly redirect users as intended, submit different information for the production app and the development app.

    Follow the steps below to submit the necessary information to the Airbridge dashboard.

    iOS

    1. Navigate to [Tracking Link]>[Deep Links] in the Airbridge dashboard.

    2. Enter the iOS URI scheme in the iOS URI Scheme field. Include ://. For example, if the iOS URI scheme is demo, enter demo://.

    3. In the Apple Developer Dashboard, navigate to [Identifier] of the app you want to set up the deep link. Find the App ID Prefix and Bundle ID.

    4. The iOS App ID is in the format of App ID Prefix+ . + Bundle ID. Enter the iOS App ID into the iOS App ID field. For example, if the App ID Prefix is prefix and the Bundle ID is example, the iOS App ID is prefix.example.

    Android

    1. Navigate to [Tracking Link]>[Deep Links] in the Airbridge dashboard.

    2. Enter the Android URI scheme into the Android URI Scheme field. Include ://. For example, if the URI scheme is demo, enter demo://.

    3. Enter the package name in the Package name field.

    4. You need to find the sha256_cert_fingerprints. Run the following command from the keystore file you are deploying.

    1
    keytool -list -v -keystore YOUR_KEYSTORE.keystore

    Find the SHA256 value in the results. The SHA256 value is the sha256_cert_fingerprints.

    1234
    Certificate fingerprints:
        MD5:  4C:65:04:52:F0:3F:F8:65:08:D3:71:86:FC:EF:C3:49
        SHA1: C8:BF:B7:B8:94:EA:5D:9D:38:59:FE:99:63:ED:47:B2:D9:5A:4E:CC
        SHA256: B5:EF:4D:F9:DC:95:E6:9B:F3:9A:5E:E9:D6:E0:D8:F6:7B:AB:79:C8:78:67:34:D9:A7:01:AB:6A:86:01:0E:99

    5. Enter the SHA256 value into the sha256_cert_fingerprints field.

    After entering the deep link information into the Airbridge dashboard, an additional setup is required to enable the following.

    • App launch with Airbridge Deep Links

    • Airbridge Deep Link event collection

    • User redirection with Airbridge Deep Links

    For detailed instructions, refer to the information below.

    Perform the following setup to enable app launch with Airbridge Deep Links after the user clicks on a tracking link.

    iOS

    1. For the scheme deep link setup, navigate to [YOUR_PROJECT]>[Info]>[URL Types] in Xcode.

    2. Click + and enter the iOS URI scheme you submitted to the Airbridge dashboard into the URL Schemes field.

    Attention

    When entering the iOS URL scheme, exclude ://.

    3. For the Universal Link setup, navigate to [YOUR_PROJECT]>[Signing & Capabilities] in Xcode.

    4. Click + Capability to add Associated Domains.

    5. Add applinks:YOUR_APP_NAME.airbridge.io and applinks:YOUR_APP_NAME.abr.ge to Associated Domains.

    YOUR_APP_NAME is the App Name.

    Attention

    If you are using or plan to use the Password AutoFill feature, you must add the Webcredentials domain. A situation may arise where the domain of the password saved through the Password AutoFill feature appears as airbridge.io or abr.ge to your app users.

    Refer to this article for more details.

    Android

    1. For the scheme deep link setup, add an intent filter to the Activity that handles deep links in the AndroidManifest.xml.

    The intent filter you add must use the Android URI Scheme you submitted to the Airbridge dashboard.

    123456789101112
    <activity ...>
        ...
        <intent-filter>
            <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_SCHEME" />
        </intent-filter>
        ...
    </activity>

    Attention

    Always use separate <intent-filter> tags. If you add all <data> tags to a single <intent-filter> tag, deep links may not open your app properly.

    2. For the App Links setup, add an intent filter under the Activity that handles the deep link in the AndroidManifest.xml.

    YOUR_APP_NAME is the App Name.

    12345678910111213141516171819202122
    <activity ...>
        ...
        <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="http" android:host="YOUR_APP_NAME.abr.ge" />
            <data android:scheme="https" android:host="YOUR_APP_NAME.abr.ge" />
        </intent-filter>
        <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="http" android:host="YOUR_APP_NAME.airbridge.io" />
            <data android:scheme="https" android:host="YOUR_APP_NAME.airbridge.io" />
        </intent-filter>
        ...
    </activity>

    Attention

    Always use separate <intent-filter> tags. If you add all <data> tags to a single <intent-filter> tag, deep links may not open your app properly.

    To pass the deep link events to the Airbridge SDK, the Airbridge.trackDeeplink function should be called at the top of the OS callback triggered when the app is opened through a deep link.

    iOS

    Add the following code snippet to the ios/YOUR_PROJECT_NAME/AppDelegate.m file.

    1234567891011121314151617181920212223
    // when app is opened with scheme deeplink
    func application(
        _ app: UIApplication,
        open url: URL,
        options: [UIApplication.OpenURLOptionsKey : Any] = [:]
    ) -> Bool {
        // track deeplink
        AirbridgeCordova.trackDeeplink(url: url)
    
        return true
    }
    ...
    // when app is opened with universal links
    func application(
        _ application: UIApplication,
        continue userActivity: NSUserActivity,
        restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
    ) -> Bool {
        // track deeplink
        AirbridgeCordova.trackDeeplink(userActivity: userActivity)
    
        return true
    }
    123456789101112131415
    // when app is opened with scheme deeplink
    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
        // track deeplink
        [AirbridgeCordova trackDeeplinkWithUrl:url];
    
        return YES;
    }
    ...
    // when app is opened with universal links
    - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
        // track deeplink
        [AirbridgeCordova trackDeeplinkWithUserActivity:userActivity];
    
        return YES;
    }

    Android

    Add the following code snippet to the android/app/src/main/java/.../MainActivity.kt file.

    1234567891011
    import co.ab180.airbridge.cordova.AirbridgeCordova
    ...
    override fun onResume() {
        super.onResume()
        AirbridgeCordova.trackDeeplink(intent)
    }
    ...
    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
        setIntent(intent)
    }
    12345678910111213
    import co.ab180.airbridge.cordova.AirbridgeCordova;
    ...
    @Override
    protected void onResume() {
        super.onResume();
        AirbridgeCordova.trackDeeplink(intent);
    }
    ...
    @Override
    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
    }

    When an Airbridge deep link is launched, it is converted to a scheme deep link and passed to the OnDeeplinkReceived callback. If a deep link from a different platform other than Airbridge is launched, it is passed to the callback without conversion.

    The received deep link is used to redirect the user to the intended destination.

    123
    Airbridge.setOnDeeplinkReceived(function (url) {
        // show proper content using url
    });

    Set up deferred deep linking

    When a user clicks on a tracking link with deferred deep linking capabilities and the app is not installed on the device, the Airbridge SDK collects the deep link as follows.

    The Airbridge SDK attempts to collect a deep link after initializing the SDK when all the following conditions are met. If the app is closed during collection, the Airbridge SDK treats it as if there is no stored Airbridge deep link.

    • The Airbridge.startTracking function is called with the opt-in settings in place. Or, opt-in has not been set.

    • The ATT tracking response has been determined. Or, the event collection delay time set in the ATT prompt has expired.

    Deferred deep links are automatically passed to OnDeeplinkReceived, so no additional setup is required.

    In-app Events

    The Airbridge SDK collects user actions from the app as per settings and sends them as in-app events.

    Send in-app events

    Setting up a Hybrid App

    You can set up the Cordova-Ionic SDK to handle Airbridge-related tasks within the in-app website without changing the website's code for your hybrid app.

    The Airbridge.trackEvent function must be called to send events. Refer to the information below about the required Airbridge.trackEvent function components and their types.

    1234567891011
    /**
     * Tracks user behavior through event tracking with attributes.
     * @param category Name of event.
     * @param semanticAttributes Additional attributes of the event that defined by Airbridge.
     * @param customAttributes Additional attributes of the event.
     */
    static trackEvent(
        category: string,
        semanticAttributes?: Record<string, any>,
        customAttributes?: Record<string, any>,
    ): void

    Component

    Required

    Type

    Description

    category

    Required

    string

    Event name

    semanticAttributes

    Optional

    Record<string, any>

    Semantic attributes of the events

    customAttributes

    Optional

    Record<string, any>

    Custom attributes of the events

    Refer to the component definition and available strings below.

    The Standard Event Categories provided by the Airbridge SDK can be found in the AirbridgeCategory. You can also enter the Event Categories from the list of Standard Events.

    Custom events can be sent by entering the event names in the event taxonomy.

    Refer to the example below.

    123456
    // track standard event (provided by sdk)
    Airbridge.trackEvent(AirbridgeCategory.ORDER_COMPLETED)
    // track standard event (not provided by sdk)
    Airbridge.trackEvent('airbridge.ecommerce.order.canceled')
    // track custom event
    Airbridge.trackEvent('eventViewed')

    Attention

    The Airbridge SDK v4 attributes differ from the previous version. The previous version's attributes do not include action, label, and value.

    Additional information about the event can be collected using attributes.

    • Action, Label: Collect information that can be used as GroupBys in the Airbridge reports

    • Value: Collect information that can be used for sales analysis. Airbridge can perform calculations using the collected data.

    • Semantic Attribute: Collect predefined attributes by Airbridge.

    • Custom Attributes: Collect attributes defined by Airbridge users.

    You can enter Action, Label, Value, and Semantic Attributes using the semanticAttributes parameter of the Airbridge.trackEvent function and enter Custom Attributes using the customAttributes parameter.

    Use the semanticAttributes parameter of the Airbridge.trackEvent function to enter Action, Label, Value, and Semantic Attributes, and the customAttributes parameter to enter Custom Attributes.

    The semantic attributes predefined by Airbridge can be found in the user guide below.

    Refer to the example below.

    123456789101112131415161718192021222324252627
    Airbridge.trackEvent(
        AirbridgeCategory.ORDER_COMPLETED,
        {
            // action
            [AirbridgeAttribute.ACTION]: 'Tool',
            // label
            [AirbridgeAttribute.LABEL]: 'Hammer',
            // value
            [AirbridgeAttribute.VALUE]: 10,
            // semantic attribute (provided by sdk)
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    // semantic attribute value (provided by sdk)
                    [AirbridgeAttribute.PRODUCT_ID]: '12345',
                    // semantic attribute value (not provided by sdk)
                    'name': 'PlasticHammer',
                },
            ],
            // semantic attribute (not provided by sdk)
            'totalQuantity': 1,
        },
        {
            // custom attribute
            'promotion': 'FirstPurchasePromotion',
        }
    )

    Attention

    Semantic attributes and custom attributes only allow JSON as a data type.

    • JSON types: string, number, boolean, Record<string, JSON>, Array<JSON>

    • Types that cannot be used in semantic attributes and custom attributes: Class, etc.

    The Event Category of Standard Events and Semantic Attributes provided by the SDK are as follows.

    Key

    Data

    SIGN_UP

    airbridge.user.signup

    SIGN_IN

    airbridge.user.signin

    SIGN_OUT

    airbridge.user.signout

    HOME_VIEWED

    airbridge.ecommerce.home.viewed

    PRODUCT_LIST_VIEWED

    airbridge.ecommerce.productList.viewed

    SEARCH_RESULTS_VIEWED

    airbridge.ecommerce.searchResults.viewed

    PRODUCT_VIEWED

    airbridge.ecommerce.product.viewed

    ADD_PAYMENT_INFO

    airbridge.addPaymentInfo

    ADD_TO_WISHLIST

    airbridge.addToWishlist

    ADDED_TO_CART

    airbridge.ecommerce.product.addedToCart

    INITIATE_CHECKOUT

    airbridge.initiateCheckout

    ORDER_COMPLETED

    airbridge.ecommerce.order.completed

    ORDER_CANCELED

    airbridge.ecommerce.order.canceled

    START_TRIAL

    airbridge.startTrial

    SUBSCRIBE

    airbridge.subscribe

    UNSUBSCRIBE

    airbridge.unsubscribe

    AD_IMPRESSION

    airbridge.adImpression

    AD_CLICK

    airbridge.adClick

    COMPLETE_TUTORIAL

    airbridge.completeTutorial

    ACHIEVE_LEVEL

    airbridge.achieveLevel

    UNLOCK_ACHIEVEMENT

    airbridge.unlockAchievement

    RATE

    airbridge.rate

    SHARE

    airbridge.share

    SCHEDULE

    airbridge.schedule

    SPEND_CREDITS

    airbridge.spendCredits

    Key

    Data

    Data type

    ACTION

    action

    string

    LABEL

    label

    string

    VALUE

    value

    float

    CURRENCY

    currency

    string

    PRODUCTS

    products

    array

    PRODUCT_ID

    productID

    string

    PRODUCT_NAME

    name

    string

    PRODUCT_PRICE

    price

    float

    PRODUCT_QUANTITY

    quantity

    int

    PRODUCT_CURRENCY

    currency

    string

    PRODUCT_POSITION

    position

    int

    PRODUCT_CATEGORY_ID

    categoryID

    string

    PRODUCT_CATEGORY_NAME

    categoryName

    string

    PRODUCT_BRAND_ID

    brandID

    string

    PRODUCT_BRAND_NAME

    brandName

    string

    PERIOD

    period

    string

    IS_RENEWAL

    isRenewal

    boolean

    RENEWAL_COUNT

    renewalCount

    int

    PRODUCT_LIST_ID

    productListID

    string

    CART_ID

    cartID

    string

    TRANSACTION_ID

    transactionID

    string

    TRANSACTION_TYPE

    transactionType

    string

    TRANSACTION_PAIRED_EVENT_CATEGORY

    transactionPairedEventCategory

    string

    TRANSACTION_PAIRED_EVENT_TIMESTAMP

    transactionPairedEventTimestamp

    int

    TOTAL_QUANTITY

    totalQuantity

    int

    QUERY

    query

    string

    IN_APP_PURCHASED

    inAppPurchased

    boolean

    CONTRIBUTION_MARGIN

    contributionMargin

    float

    LIST_ID

    listID

    string

    RATE_ID

    rateID

    string

    RATE

    rate

    float

    MAX_RATE

    maxRate

    float

    ACHIEVEMENT_ID

    achievementID

    string

    SHARED_CHANNEL

    sharedChannel

    string

    DATE_TIME

    datetime

    string

    DESCRIPTION

    description

    string

    IS_REVENUE

    isRevenue

    boolean

    PLACE

    place

    string

    SCHEDULE_ID

    scheduleID

    string

    TYPE

    type

    string

    LEVEL

    level

    string

    SCORE

    score

    float

    AD_PARTNERS

    adPartners

    array

    IS_FIRST_PER_USER

    isFirstPerUser

    boolean

    Refer to the example codes for each type of data below.

    12345678910111213
    Airbridge.trackEvent(
        'event',
        {
            [AirbridgeAttribute.VALUE]: 10,
        },
        {
            'string': 'string',
            'number': 1000,
            'boolean': true,
            'object': {'key': 'value'},
            'array': ['value'],
        },
    )

    Additional in-app event settings

    Attention

    The default settings will apply if no additional settings are configured. Proceed after reviewing whether additional settings are necessary.

    Configure additional settings for sending in-app events if necessary.

    The Airbridge SDK includes session information when sending event data.

    When the app moves to the background or the process is terminated, the background entry time is recorded. When the app returns to the foreground or the process is restarted, the re-entry time is recorded. If the time difference between the last background entry and re-entry exceeds the session timeout, the previous session ends and a new session begins.

    The default session timeout is 300 seconds (5 minutes). In the SDK settings, you can configure setSessionTimeout up to 604,800 seconds (7 days).

    Attention

    The Airbridge SDK collects Open events and Foreground events that initiate a new session. However, those events are not collected during a session. To collect them while the session is being maintained, additional settings are required.

    The default transmission interval is set to 0 seconds. In the SDK settings, you can adjust setEventTransmitInterval to modify it to a maximum of 86,400 seconds (1 day).

    The following table shows the default and maximum values for the number of events and storage size.

    Number of Events

    Storage Size

    Default Value

    INT_MAX

    1024 GiB

    Maximum Value Allowed

    INT_MAX

    1024 GiB

    In the SDK settings, If you want to limit the number of events the SDK stores, use the eventBufferCountLimit, and to limit the storage size of the SDK, use the eventBufferSizeLimitInGibibyte.

    When the event deletion option is activated, all in-app events that are not transmitted during the Airbridge SDK's initialization process are deleted. By default, the event deletion option is inactive.

    In the SDK settings, set setClearEventBufferOnInitializeEnabled to true to activate the event deletion option.

    123456
    import Airbridge
    ...
    let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_TOKEN")
        .setClearEventBufferOnInitializeEnabled(true)
        .build()
    Airbridge.initializeSDK(option: option)
    1234567
    #import <Airbridge/Airbridge.h>
    ...
    AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
                                                                                   token:@"YOUR_APP_TOKEN"];
    [optionBuilder setClearEventBufferOnInitializeEnabled:YES];
    AirbridgeOption* option = [optionBuilder build];
    [Airbridge initializeSDKWithOption:option];

    The Airbridge SDK supports functions to include device identifiers for all event transmissions.

    #{"width": "140px"}

    Function

    #{"width": "240px"}

    Description

    Airbridge.setDeviceAlias

    Adds additional device identifiers. Up to 10 identifiers can be entered.

    - key: Maximum 128 characters supported. Must satisfy the regular expression ^[a-zA-Z_][a-zA-Z0-9_]*$.

    - value: Maximum 128 characters supported.

    Airbridge.removeDeviceAlias

    Deletes only specified device identifiers.

    Airbridge.clearDeviceAlias

    Deletes all device identifiers.

    Refer to the example below.

    123
    Airbridge.setDeviceAlias('string', 'string')
    Airbridge.removeDeviceAlias('string')
    Airbridge.clearDeviceAlias()

    Example codes

    Airbridge collects in-app events that are classified as Standard Events and Custom Events. Standard Events are events predefined by Airbridge. Refer to the example codes below.

    Sign up

    123456789
    Airbridge.setUserID('string')
    Airbridge.setUserAlias('string', 'string')
    Airbridge.setUserEmail('string')
    Airbridge.setUserPhone('string')
    Airbridge.setUserAttribute('string', 'string')
    
    Airbridge.trackEvent(
        AirbridgeCategory.SIGN_UP,
    )

    Sign in

    123456789
    Airbridge.setUserID('string')
    Airbridge.setUserAlias('string', 'string')
    Airbridge.setUserEmail('string')
    Airbridge.setUserPhone('string')
    Airbridge.setUserAttribute('string', 'string')
    
    Airbridge.trackEvent(
        AirbridgeCategory.SIGN_IN,
    )

    Sign out

    12345
    Airbridge.trackEvent(
        AirbridgeCategory.SIGN_OUT,
    )
    
    Airbridge.clearUser()

    Home screen view

    123
    Airbridge.trackEvent(
        AirbridgeCategory.HOME_VIEWED,
    )

    Product list view

    1234567891011121314151617181920212223
    Airbridge.trackEvent(
        AirbridgeCategory.PRODUCT_LIST_VIEWED, 
        {
            [AirbridgeAttribute.LIST_ID]: '84e6e236-38c4-48db-9b49-16e4cc064386',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
                {
                    [AirbridgeAttribute.PRODUCT_ID]: 'd6ab2fbe-decc-4362-b719-d257a131e91e',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticFork',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 1,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Search results view

    1234567891011121314151617181920212223
    Airbridge.trackEvent(
        AirbridgeCategory.SEARCH_RESULTS_VIEWED, 
        {
            [AirbridgeAttribute.QUERY]: 'Plastic',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
                {
                    [AirbridgeAttribute.PRODUCT_ID]: 'd6ab2fbe-decc-4362-b719-d257a131e91e',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticFork',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 1,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Product detail page view

    123456789101112131415
    Airbridge.trackEvent(
        AirbridgeCategory.PRODUCT_VIEWED, 
        {
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Payment method registration

    123456
    Airbridge.trackEvent(
        AirbridgeCategory.ADD_PAYMENT_INFO, 
        {
            [AirbridgeAttribute.TYPE]: 'CreditCard',
        },
    )

    Adding to wishlist

    12345678910111213141516
    Airbridge.trackEvent(
        AirbridgeCategory.ADD_TO_WISHLIST, 
        {
            [AirbridgeAttribute.LIST_ID]: '189a2f8b-83ee-4074-8158-726be54e57d4',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Adding to cart

    12345678910111213141516
    Airbridge.trackEvent(
        AirbridgeCategory.ADDED_TO_CART, 
        {
            [AirbridgeAttribute.CART_ID]: '421eaeb7-6e80-4694-933e-f2e1a55e9cbd',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Start payment

    1234567891011121314151617181920212223
    Airbridge.trackEvent(
        AirbridgeCategory.INITIATE_CHECKOUT, 
        {
            [AirbridgeAttribute.TRANSACTION_ID]: '0a7ee1ec-33da-4ffb-b775-89e80e75978a',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
                {
                    [AirbridgeAttribute.PRODUCT_ID]: 'd6ab2fbe-decc-4362-b719-d257a131e91e',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticFork',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 1,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Purchase complete

    12345678910111213141516171819202122232425
    Airbridge.trackEvent(
        AirbridgeCategory.ORDER_COMPLETED, 
        {
            [AirbridgeAttribute.VALUE]: 11,
            [AirbridgeAttribute.TRANSACTION_ID]: '8065ef16-162b-4a82-b683-e51aefdda7d5',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.IN_APP_PURCHASED]: true,
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
                {
                    [AirbridgeAttribute.PRODUCT_ID]: 'd6ab2fbe-decc-4362-b719-d257a131e91e',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticFork',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 1,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Purchase cancellation

    12345678910111213141516171819202122232425
    Airbridge.trackEvent(
        AirbridgeCategory.ORDER_CANCELED, 
        {
            [AirbridgeAttribute.VALUE]: 11,
            [AirbridgeAttribute.TRANSACTION_ID]: '8065ef16-162b-4a82-b683-e51aefdda7d5',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.IN_APP_PURCHASED]: true,
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
                {
                    [AirbridgeAttribute.PRODUCT_ID]: 'd6ab2fbe-decc-4362-b719-d257a131e91e',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticFork',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 1,
                    [AirbridgeAttribute.PRODUCT_QUANTITY]: 1,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Start trial

    12345678910111213141516
    Airbridge.trackEvent(
        AirbridgeCategory.START_TRIAL, 
        {
            [AirbridgeAttribute.TRANSACTION_ID]: 'ef1e5271-0370-407c-b1e9-669a8df1dc2c',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PERIOD]: 'P1M',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '306a57cb-f653-4220-a208-8405d8e4d506',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'MusicStreamingMemebership',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 15,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Subscription

    123456789101112131415161718
    Airbridge.trackEvent(
        AirbridgeCategory.SUBSCRIBE, 
        {
            [AirbridgeAttribute.VALUE]: 15,
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.TRANSACTION_ID]: 'cbe718c7-e44e-4707-b5cd-4a6a29f29649',
            [AirbridgeAttribute.PERIOD]: 'P1M',
            [AirbridgeAttribute.IS_RENEWAL]: true,
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '306a57cb-f653-4220-a208-8405d8e4d506',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'MusicStreamingMemebership',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 15,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Unsubscribe

    1234567891011121314151617
    Airbridge.trackEvent(
        AirbridgeCategory.UNSUBSCRIBE, 
        {
            [AirbridgeAttribute.VALUE]: 15,
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.TRANSACTION_ID]: 'cbe718c7-e44e-4707-b5cd-4a6a29f29649',
            [AirbridgeAttribute.IS_RENEWAL]: true,
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '306a57cb-f653-4220-a208-8405d8e4d506',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'MusicStreamingMemebership',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 15,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Ad exposure

    1234567891011121314151617181920212223242526
    Airbridge.trackEvent(
        AirbridgeCategory.AD_IMPRESSION, 
        {
            [AirbridgeAttribute.VALUE]: 0.01,
            [AirbridgeAttribute.AD_PARTNERS]: {
                'mopub': {
                    'app_version': '5.18.0',
                    'adunit_id': '12345',
                    'adunit_name': '12345',
                    'adunit_format': 'Banner',
                    'id': '12345',
                    'currency': 'USD',
                    'publisher_revenue': 12345.123,
                    'adgroup_id': '12345',
                    'adgroup_name': '12345',
                    'adgroup_type': '12345',
                    'adgroup_priority': '12345',
                    'country': 'kr',
                    'precision': 'publisher_defined',
                    'network_name': '12345',
                    'network_placement_id': '12345',
                    'demand_partner_data': '12345',
                },
            },
        },
    )

    Ad click

    1234567891011121314151617181920212223242526
    Airbridge.trackEvent(
        AirbridgeCategory.AD_CLICK, 
        {
            [AirbridgeAttribute.VALUE]: 0.1,
            [AirbridgeAttribute.AD_PARTNERS]: {
                'mopub': {
                    'app_version': '5.18.0',
                    'adunit_id': '12345',
                    'adunit_name': '12345',
                    'adunit_format': 'Banner',
                    'id': '12345',
                    'currency': 'USD',
                    'publisher_revenue': 12345.123,
                    'adgroup_id': '12345',
                    'adgroup_name': '12345',
                    'adgroup_type': '12345',
                    'adgroup_priority': '12345',
                    'country': 'kr',
                    'precision': 'publisher_defined',
                    'network_name': '12345',
                    'network_placement_id': '12345',
                    'demand_partner_data': '12345',
                },
            },
        },
    )

    Tutorial completion

    123456
    Airbridge.trackEvent(
        AirbridgeCategory.COMPLETE_TUTORIAL, 
        {
            [AirbridgeAttribute.DESCRIPTION]: 'Finish Initial Tutorial',
        },
    )

    Level achievement

    123456
    Airbridge.trackEvent(
        AirbridgeCategory.ACHIEVE_LEVEL, 
        {
            [AirbridgeAttribute.LEVEL]: 13,
        },
    )

    Task completion

    12345678
    Airbridge.trackEvent(
        AirbridgeCategory.UNLOCK_ACHIEVEMENT, 
        {
            [AirbridgeAttribute.ACHIEVEMENT_ID]: '36a0f0bb-b153-4be1-a3e0-3cb5b2b076c1',
            [AirbridgeAttribute.DESCRIPTION]: 'Get Score Over 50',
            [AirbridgeAttribute.SCORE]: 80,
        },
    )

    Evaluation

    1234567891011121314151617
    Airbridge.trackEvent(
        AirbridgeCategory.RATE, 
        {
            [AirbridgeAttribute.RATE_ID]: '531c64b3-4704-4780-a306-89014ec18daf',
            [AirbridgeAttribute.RATE]: 4.5,
            [AirbridgeAttribute.MAX_RATE]: 5,
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Sharing

    1234567
    Airbridge.trackEvent(
        AirbridgeCategory.SHARE, 
        {
            [AirbridgeAttribute.DESCRIPTION]: 'Share Promotion',
            [AirbridgeAttribute.SHARED_CHANNEL]: 'CopyLink',
        },
    )

    Schedule reservation

    1234567891011121314
    Airbridge.trackEvent(
        AirbridgeCategory.SCHEDULE, 
        {
            [AirbridgeAttribute.SCHEDULE_ID]: '75712915-2cd9-4e42-a85e-8d42f356f4c6',
            [AirbridgeAttribute.DATE_TIME]: '2024-01-01T00:00:00+00:00',
            [AirbridgeAttribute.PLACE]: 'ConferenceRoom',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: 'abb3e65d-17bc-4b28-89e3-5e356c0ea697',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'ConferenceRoom',
                },
            ],
        },
    )

    Credit use

    123456789101112131415
    Airbridge.trackEvent(
        AirbridgeCategory.SPEND_CREDITS, 
        {
            [AirbridgeAttribute.TRANSACTION_ID]: '22eb193d-be11-4fe4-95da-c91a196faf1c',
            [AirbridgeAttribute.CURRENCY]: 'USD',
            [AirbridgeAttribute.PRODUCTS]: [
                {
                    [AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
                    [AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
                    [AirbridgeAttribute.PRODUCT_PRICE]: 10,
                    [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
                },
            ],
        },
    )

    Custom Events are events defined by Airbridge users to track user actions that are unique to their services. Refer to the example code below.

    12345678910111213
    Airbridge.trackEvent(
        'event',
        {
            [AirbridgeAttribute.VALUE]: 10,
        },
        {
            'string': 'string',
            'number': 1000,
            'boolean': true,
            'object': {'key': 'value'},
            'array': ['value'],
        },
    )

    User Data

    Airbridge sends user data along with events. User data allows for a more accurate ad performance measurement.

    Set up User ID

    User IDs refer to the user identifier used in a service. User IDs should be unique IDs that can identify unique users across websites and apps.

    #{"width":"140px"}

    Function

    #{"width":"240px"}

    Description

    Airbridge.setUserID

    Inputs the user ID.

    Airbridge.clearUserID

    Deletes the user ID.

    Airbridge.setUserAlias

    Adds additional user identifiers. Up to 10 items can be added.
    - key: Up to 128 characters supported. Must follow the regular expression ^[a-zA-Z_][a-zA-Z0-9_]*$.
    - value: Up to 1024 characters supported.

    Airbridge.removeUserAlias

    Deletes only specified identifiers.

    Airbridge.clearUserAlias

    Deletes all additional user identifiers.

    Refer to the example below.

    1234567
    // identifier
    Airbridge.setUserID('string')
    Airbridge.clearUserID()
    // addtional identifier
    Airbridge.setUserAlias('string', 'string')
    Airbridge.removeUserAlias('string')
    Airbridge.clearUserAlias()

    Send additional user information

    Attention

    Sensitive user information may be included. Send after a thorough review with a legal advisor.

    Refer to the functions below to send additional user information.

    #{"width":"140px"}

    Function

    #{"width":"240px"}

    Description

    Airbridge.setUserEmail

    Input the user email. The data is hashed using SHA256.

    Airbridge.clearUserEmail

    Deletes the user email.

    Airbridge.setUserPhone

    Inputs the user's phone number. The data is hashed using SHA256.

    Airbridge.clearUserPhone

    Deletes the user's phone number.

    Airbridge.setUserAttribute

    Adds additional user attributes. Up to 100 items can be added.

    - key: Up to 128 characters supported. Must satisfy the regular expression: ^[a-zA-Z_][a-zA-Z0-9_]*$.

    - value: Only supports string, number, and Boolean types. Up to 1024 characters supported.

    Airbridge.removeUserAttribute

    Deletes only specified attributes from the additional attributes.

    Airbridge.clearUserAttributes

    Deletes all additional user attributes.

    Refer to the example below.

    12345678910
    // email, phone
    Airbridge.setUserEmail('string')
    Airbridge.clearUserEmail()
    Airbridge.setUserPhone('string')
    Airbridge.clearUserPhone()
    // addtional attribute
    Airbridge.setUserAttribute('string', 'string')
    Airbridge.setUserAttribute('number', 1000)
    Airbridge.removeUserAttribute('string')
    Airbridge.clearUserAttributes()

    Hash user information

    When hashUserInformationEnabled is set to false in the SDK settings, user emails and phone numbers are passed without being hashed. The default setting is true.

    Clear user data

    You can reset user information with the Airbridge.clearUser function.

    1
    Airbridge.clearUser()

    Additional SDK Settings

    Follow the instructions below for additional setup.

    Attention

    Optional settings. Configure only if necessary.

    Attention

    Cordova-Ionic SDK v.4.3.0 or later is required.

    Tracking links are links that are embedded in ads for data collection. When users click on the ad, the tracking link is used to pass the touchpoint data to Airbridge, allowing for ad attribution.

    Also, users who click on the ad with a tracking link can be redirected to a specific destination.

    Use the createTrackingLink function to create tracking links. Refer to the code examples and the parameter details below.

    123456
    static createTrackingLink(
        channel: string,
        option: Record<string, any>,
        onSuccess: (airbridgeTrackingLink: AirbridgeTrackingLink) => void,
        onFailure?: (error: Error) => void
    ): void

    Name

    Required or Optional

    Type

    Description

    channel

    Required

    String

    The ad channel where the tracking link is used

    option

    Required

    Record<String, Object>

    Options for creating tracking links

    onSuccess

    Required

    (airbridgeTrackingLink: AirbridgeTrackingLink) => void

    Success callback

    onFailure

    Optional

    (error: Error) => void

    Fail callback

    Use the option parameter in the createTrackingLink function to configure tracking link options.

    Key

    Type

    Description

    AirbridgeTrackingLinkOption.CAMPAIGN

    String

    The campaign credited with the winning touchpoint or conversion.

    AirbridgeTrackingLinkOption.AD_GROUP

    String

    The ad group credited with the winning touchpoint or conversion.

    AirbridgeTrackingLinkOption.AD_CREATIVE

    String

    The ad creative credited with the winning touchpoint or conversion.

    AirbridgeTrackingLinkOption.CONTENT

    String

    The content credited with the winning touchpoint or conversion.

    AirbridgeTrackingLinkOption.TERM

    String

    The search term credited with the winning touchpoint or conversion.

    AirbridgeTrackingLinkOption.SUB_ID

    String

    The sub publisher that generated the touchpoint.
    Sub media values are usually provided by predefined "integrated" channels.

    AirbridgeTrackingLinkOption.SUB_ID_1

    String

    The 1st level sub-sub publisher that generated the touchpoint.
    Sub media values are usually provided by predefined "integrated" channels.

    AirbridgeTrackingLinkOption.SUB_ID_2

    String

    The 2nd level sub-sub publisher that generated the touchpoint.
    Sub media values are usually provided by predefined "integrated" channels.

    AirbridgeTrackingLinkOption.SUB_ID_3

    String

    The 3rd level sub-sub publisher that generated the touchpoint.
    Sub media values are usually provided by predefined "integrated" channels.

    AirbridgeTrackingLinkOption.DEEPLINK_URL

    (Custom Scheme URL String)

    Deeplink URL

    AirbridgeTrackingLinkOption.DEEPLINK_STOPOVER

    Boolean

    Whether to enable the stopover feature of Deeplink
    true : enable
    false : disable

    AirbridgeTrackingLinkOption.FALLBACK_IOS

    ("store" | Web URL String)

    ios fallback when app is not installed

    AirbridgeTrackingLinkOption.FALLBACK_ANDROID

    ("store" | Web URL String)

    android fallback when app is not installed

    AirbridgeTrackingLinkOption.FALLBACK_DESKTOP

    (Web URL String)

    desktop fallback when app is not installed

    AirbridgeTrackingLinkOption.FALLBACK_IOS_STORE_PPID

    String

    The ppid for the Custom Product Page in the Apple App Store.

    Enable the custom product page to be shown when landing in the App Store.

    AirbridgeTrackingLinkOption.FALLBACK_ANDROID_STORE_LISTING

    String

    The Custom Store Listing listing value for the Google Play Store.

    Enables the display of your custom store listing when landing on the Google Play Store.

    AirbridgeTrackingLinkOption.OGTAG_TITLE

    String

    og:title for tracking link

    AirbridgeTrackingLinkOption.OGTAG_DESCRIPTION

    String

    og:description for tracking link

    AirbridgeTrackingLinkOption.OGTAG_IMAGE_URL

    (Web URL String)

    og:image for tracking link

    AirbridgeTrackingLinkOption.OGTAG_WEBSITE_CRAWL

    ("desktop")

    A customization of link-preview.. Airbridge crawl og-tag from response of FALLBACK_DESKTOP.
    The values set for title, description, and imageUrl are ignored.

    AirbridgeTrackingLinkOption.CUSTOM_SHORT_ID

    String

    Configure the short ID of tracking links depending on your campaign or contents.
    If not passed, a random short ID will be generate, and can not be changed once generated.

    AirbridgeTrackingLinkOption.IS_REENGAGEMENT

    ("off" | "on_true" | "on_false")

    Configure the Re-engagement parameter. The Re-engagement parameter has three options.
    off: OFF is the default setting. The touchpoint can be attributed to both install events and post-install events (in-app events).
    on_true: ON-TRUE is used for re-engagement campaigns for installed users. The touchpoint generated by the tracking link is attributed only to the deeplink open and the following in-app events, not to the install event.
    on_false: ON-FALSE is used for user acquisition campaigns targeting uninstalled users. The touchpoint generated by the tracking link is attributed only to the install event and the following in-app events, not to the 'deeplink open' event.

    Use the onSuccess callback in the createTrackingLink function to pass the AirbridgeTrackingLink.

    12345678910
    /**
     * Holds variable types of tracking-link that move user
     * to specific page of app and track click-event.
     */
    export type AirbridgeTrackingLink = {
        /// A tracking-link url contains short mapping-id of option
        shortURL: string
        /// A qrcode image-url of tracking-link
        qrcodeURL: string
    }

    Name

    Type

    Description

    shortURL

    String

    The short URL of the tracking link

    qrcodeURL

    String

    The QR code URL of the tracking link

    Refer to the example codes below.

    12345678910111213141516
    Airbridge.createTrackingLink(
        "test_channel",
        {
            [AirbridgeTrackingLinkOption.CAMPAIGN]: 'test_campaign',
            [AirbridgeTrackingLinkOption.DEEPLINK_URL]: 'YOUR_SCHEME://...',
            [AirbridgeTrackingLinkOption.FALLBACK_IOS]: 'store',
            [AirbridgeTrackingLinkOption.FALLBACK_ANDROID]: 'store',
            [AirbridgeTrackingLinkOption.FALLBACK_DESKTOP]: 'https://example.com/'
        },
        (trackingLink) => {
            // Handling created tracking-link
        },
        (error) => {
            // Handling error
        }
    )

    1234567891011121314151617
    Airbridge.createTrackingLink(
        "test_channel",
        {
            [AirbridgeTrackingLinkOption.CAMPAIGN]: 'test_campaign',
            [AirbridgeTrackingLinkOption.DEEPLINK_URL]: 'sample://home',
            [AirbridgeTrackingLinkOption.FALLBACK_IOS]: 'https://example.com/',
            [AirbridgeTrackingLinkOption.FALLBACK_ANDROID]: 'https://example.com/',
            [AirbridgeTrackingLinkOption.FALLBACK_DESKTOP]: 'https://example.com/'
        },
        (trackingLink) => {
            // Handling created tracking-link
        },
        (error) => {
            // Handling error
    
        }
    )

    123456789101112131415
    Airbridge.createTrackingLink(
        "test_channel",
        {
            [AirbridgeTrackingLinkOption.CAMPAIGN]: 'test_campaign',
            [AirbridgeTrackingLinkOption.FALLBACK_IOS]: 'store',
            [AirbridgeTrackingLinkOption.FALLBACK_ANDROID]: 'store',
            [AirbridgeTrackingLinkOption.FALLBACK_DESKTOP]: 'https://example.com/'
        },
        (trackingLink) => {
            // Handling created tracking-link
        },
        (error) => {
            // Handling error
        }
    )

    123456789101112131415
    Airbridge.createTrackingLink(
        "test_channel",
        {
            [AirbridgeTrackingLinkOption.CAMPAIGN]: 'test_campaign',
            [AirbridgeTrackingLinkOption.FALLBACK_IOS]: 'https://example.com/',
            [AirbridgeTrackingLinkOption.FALLBACK_ANDROID]: 'https://example.com/',
            [AirbridgeTrackingLinkOption.FALLBACK_DESKTOP]: 'https://example.com/'
        },
        (trackingLink) => {
            // Handling created tracking-link
        },
        (error) => {
            // Handling error
        }
    )

    Note

    The Airbridge Cordova-Ionic SDK must be v4.2.0 or later.

    The deep links passed through the setOnDeeplinkReceived method of the Airbridge Cordova-Ionic SDK include not only Airbridge Deep Links but also deep links from other solutions.

    123
    Airbridge.setOnDeeplinkReceived(function (url) {
        // show proper content using url
    })

    By configuring isHandleAirbridgeDeeplinkOnly to true in the SDK settings, only Airbridge Deep Links will be passed to the setOnDeeplinkReceived callback. In this way, you can handle the deep links from other solutions separately from the Airbridge Deep Links.

    Depending on how links are opened, it may be challenging to properly use the tracking link within the app.

    By using the Airbridge.click function or the Airbridge.impression function, you can properly use the tracking link within the app without sending users to an external browser.

    When a user clicks a tracking link in the app, the Airbridge.click function is called. Depending on the tracking link settings, the scheme deep link is delivered, or the user is redirected to the app store or website.

    123456789
    const isHandled = Airbridge.click(url, () => {
        // when url is tracking link and succeed
    }, (error) => {
        // when url is tracking link and failed
        // example: url is another app's tracking link, internet is not connected
    })
    if (!isHandled) {
        // when url is not tracking link
    }

    When a user engages with the tracking link, the Airbridge.impression function is called, and the impression event data is collected.

    123456789
    const isHandled = Airbridge.impression(url, () => {
        // when url is tracking link and succeed
    }, (error) => {
        // when url is tracking link and failed
        // example: url is another app's tracking link, internet is not connected
    })
    if (!isHandled) {
        // when url is not tracking link
    }

    Attention

    When you set up the Airbridge SDK to use tracking links within apps, every time a tracking link is used within the app, Deeplink Pageviews are aggregated as Target Events. The deep link performance may be affected when Deeplink Pageviews occur frequently right after Deeplink Opens.

    The attribution window for Deeplink Pageviews is set to 3 days by default. If you want to change the attribution window for Deeplink Pageviews, contact your Airbridge CSM. If you don't have a designated CSM, contact the Airbridge Help Center.

    Get attribution results

    Attention

    It takes some time for the Airbridge SDK to collect attribution results. We do not recommend using attribution results for functionalities requiring real-time processing.

    Use the Airbridge.setOnAttributionReceived function to get the attribution data of install events.

    123
    Airbridge.setOnAttributionReceived((attribution) => {
        // when attribution is received
    })

    Depending on whether the attribution result exists or not, data is passed as follows.

    If the attribution result exists, a dictionary including the values below will be passed to the callback. All keys provide the attribution data. For example, attributedChannel contains information about the ad channel to which the ad performance is attributed.

    The attribution results are passed to the callback within 1 minute after SDK initialization. If the app is closed before the attribution result is passed, the previous attribution results will be passed to the callback within 1 minute the next time the app is launched. Depending on network conditions and other factors, there may be a delay of up to 5 minutes.

    Key

    Type

    Description

    attributedChannel

    String

    Channel

    attributedCampaign

    String

    Campaign

    attributedAdGroup

    String

    Ad Group

    attributedAdCreative

    String

    Ad Creative

    attributedContent

    String

    Content

    attributedTerm

    String

    Keyword

    attributedSubPublisher

    String

    Sub Publisher

    attributedSubSubPublisher1

    String

    Sub Sub Publisher 1

    attributedSubSubPublisher2

    String

    Sub Sub Publisher 2

    attributedSubSubPublisher3

    String

    Sub Sub Publisher 3

    If there is no attribution result, the following dictionary will be sent to the callback. For this data to be passed, the app must be launched again at least 3 hours after the SDK initialization.

    123
    {
        "attributedChannel": "unattributed"
    }

    When a user clicks a push notification, the deep link information in the payload should be passed to the Airbridge SDK to enable the collection of deep link events. Use the Airbridge.trackDeeplink function.

    iOS

    Add the following code to the ios/YOUR_PROJECT_NAME/AppDelegate.m file.

    12345678910111213141516171819202122232425262728
    import Airbridge
    
    func application(
        _ application: UIApplication,
        didReceiveRemoteNotification userInfo: [AnyHashable : Any],
        fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
    ) {
        if UIApplication.shared.applicationState == .inactive {
            let url = // 푸시 알림 페이로드의 딥링크
    
            Airbridge.trackDeeplink(url)
        }
    }
    
    func userNotificationCenter(
        _ center: UNUserNotificationCenter,
        didReceive response: UNNotificationResponse,
        withCompletionHandlercompletionHandler: @escaping () -> Void
    ) {
        if 
            UIApplication.shared.applicationState == .inactive || UIApplication.shared.applicationState == .background,
            response.actionIdentifier == UNNotificationDefaultActionIdentifier
        {
            let url = // 푸시 알림 페이로드의 딥링크
    
            Airbridge.trackDeeplink(url)
        }
    }
    12345678910111213141516171819
    #import <Airbridge/Airbridge.h>
    
    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
        if (UIApplication.sharedApplication.applicationState == UIApplicationStateInactive) {
            NSURL* url = // 푸시 알림 페이로드의 딥링크
    
            [Airbridge trackDeeplinkWithUrl:url];
        }
    }
    
    - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler {
        if ((UIApplication.sharedApplication.applicationState == UIApplicationStateInactive || UIApplication.sharedApplication.applicationState == UIApplicationStateBackground)
            && [response.actionIdentifier isEqual:UNNotificationDefaultActionIdentifier])
        {
            NSURL* url = // 푸시 알림 페이로드의 딥링크
    
            [Airbridge trackDeeplinkWithUrl:url];
        }
    }

    Android

    No setup is required as the events are automatically collected on Android.

    The Airbridge SDK collects deep link events when the app is opened through a deep link, even if the deep link is not an Airbridge Deep Link. Configure trackAirbridgeDeeplinkOnlyEnabled in the SDK settings to true to collect deep link events only if the app is opened through an Airbridge Deep Link and prevent unnecessary event collection.

    Compliance with Google DMA

    To comply with the Digital Markets Act (DMA), the user consent data must be sent to Airbridge. For more information about the DMA and whether it applies to your service, refer to the Airbridge user guide.

    Attention

    Advertisers must collect user consent data from all existing and new users in the EEA at least once starting March 6, 2024.

    If you are collecting user consent data using a consent management platform that complies with the Transparency and Consent Framework v2.2 protocol, refer to the following method to pass the user consent data to the Airbridge SDK.

    Note

    Cordova-Ionic SDK v.4.4.0 or later is required.

    1. In the SDK settings, set the collectTCFDataEnabled to true and the autoStartTrackingEnabled to false.

    1234
    {
        "autoStartTrackingEnabled": false,
        "collectTCFDataEnabled": true
    }

    2. After the user consent data is stored in the consent management platform, call the startTracking function.

    12
    // Explicitly start tracking
    Airbridge.startTracking()

    For all other cases, refer to the following method.

    Note

    Airbridge cannot provide guidance on storing the user consent data and implementing the prompts. For assistance, consult legal professionals.

    1. Check the location of the users who launched the app. If their location is within the EEA, check whether the user consent data has been previously collected. If not, user consent data collection is not required.

    In the SDK settings, set the autoStartTrackingEnabled to false

    123
    {
        "autoStartTrackingEnabled": false
    }

    2. If no user consent data has been collected previously, you may collect the data using a prompt or other means. The user consent data fields that need to be collected are adPersonalization, adUserData.

    Send the user consent data and the user location data (eea) to the Airbridge SDK using the Airbridge.setDeviceAlias function.

    12345678
    import { Airbridge } from 'airbridge-react-native-sdk'
    ...
    // deliver informations to sdk using device alias
    // based on actual region
    Airbridge.setDeviceAlias('eea', '0' or '1')
    // based on actual user consent
    Airbridge.setDeviceAlias('adPersonalization', '0' or '1')
    Airbridge.setDeviceAlias('adUserData', '0' or '1')

    Refer to the table below for the user consent data and the user location data that need to be sent to the Airbridge SDK. Note that the Airbridge field names listed in the table below must be used to successfully send data.

    #{"width":"80px"}

    Airbridge Field Name

    #{"width":"80px"}

    Google Field Name

    #{"width":"160px"}

    Description

    eea

    <string>

    eea

    Data indicating whether the user location is within the EEA or not

    - 0: Non-EEA. DMA not applicable.

    - 1: EEA. DMA applicable.

    adPersonalization

    <string>

    ad_personalization

    Data indicating whether the user allowed data tracking for ad personalization

    - 0: User didn't allow tracking.

    - 1: User allowed tracking.

    adUserData

    <string>

    ad_user_data

    Data indicating whether the user allowed data sharing with Google

    - 0: User didn't allow sharing.

    - 1: User allowed sharing.

    3. After the user consent data and the user location data are sent to the Airbridge SDK, call the startTracking function.

    12
    // Explicitly start tracking
    Airbridge.startTracking()

    Follow the steps below to use deferred deep linking in Meta ads. The Airbridge SDK collects the Meta deferred app links before it collects the Airbridge deferred deep links. If there are no Meta deferred app links, the Airbridge deferred deep links are collected.

    Note that Meta does not support Meta deferred app links for SKAdNetwork campaigns.

    1. Install the Facebook SDK by referring to the Meta ads documentation for iOS and Android.

    2. Configure the trackMetaDeferredAppLinkEnabled in the SDK settings to true.

    Initialize the Airbridge SDK with all functions disabled

    Attention

    If the SDK is not enabled immediately after the SDK initialization, the Install, Open, and Deeplink Openbvevents may not be collected.

    Upon initialization, all functions of the SDK are enabled by default. By configuring sdkEnabled in the SDK settings to false, the SDK can be initialized with all functions disabled.

    You can also check the activation status of the Airbridge SDK and enable or disable all functions, as in the following example.

    123
    Airbridge.isSDKEnabled()
    Airbridge.enableSDK()
    Airbridge.disableSDK()

    Set up Meta Install Referrer collection

    To collect the Meta Install Referrer, enter the Meta App ID as the key value for metaInstallReferrerAppID in the SDK settings.

    Note that the decryption key must be submitted to the Airbridge dashboard to read the decrypted Meta Install Referrer. Refer to this user guide to learn how to enter the decryption key.

    Set up uninstall tracking

    Airbridge sends a silent push every day between 3:00 PM and 4:00 PM (UTC) to users who performed an app event at least once in the last 6 months to check if the app has been deleted. You can check the uninstall event in the Airbridge reports and raw data export files.

    Refer to the article below for the detailed setup instructions.

    Integrate with third-party solutions

    An additional SDK setup is required to integrate with some third-party solutions. It is recommended that you complete this setup before collecting data with the Airbridge SDK.

    Refer to the articles listed below for integrating with third-party solutions.

    SDK logs

    The logs provided by the Airbridge SDK are categorized into Debug, Info, Warning, Error, and Fault levels. The Debug level is the least critical log, while the Fault level is the most critical log.

    By default, the Airbridge SDK provides logs at Warning, Error, and Fault levels. By entering a specific log level as the setLogLevel value in the SDK settings, the logs from that specified level up to the Fault level will be available.

    Was this helpful?

    Any questions or suggestions?