Attention
This is a guide for installing and setting up the React Native SDK v4. For previous versions, refer to the React Native SDK (v1) guide.
Install the Airbridge React Native SDK and implement the necessary settings following the steps below.
The Airbridge React Native SDK can be installed using the method below. After installation, you can verify whether the SDK has been properly installed through a React Native SDK Test.
1. Install airbridge-react-native-sdk using npm.
npm install airbridge-react-native-sdk
2. Install iOS dependencies using CocoaPods. (Android dependencies are installed automatically.)
cd ios; pod install
Attention
Install only one version of the SDK, either the general SDK or the restricted SDK.
Depending on policies and environments, restrictions on collecting device IDs like GAID and IDFA may be required. When installing the Restricted SDK version, the device IDs are not collected.
Install the Restricted SDK using the method below.
1. Install airbridge-react-native-sdk using npm.
npm install airbridge-react-native-sdk-restricted
2. Install iOS dependencies using CocoaPods. (Android dependencies are installed automatically.)
cd ios; pod install
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.
Add the following code snippet to the ios/YOUR_PROJECT_NAME/AppDelegate.m
file.
import AirbridgeReactNative
...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
AirbridgeReactNative.initializeSDK(name: "YOUR_APP_NAME", token:"YOUR_APP_SDK_TOKEN")
...
}
#import <AirbridgeReactNative/AirbridgeReactNative.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AirbridgeReactNative initializeSDKWithName:@"YOUR_APP_NAME" token:@"YOUR_APP_SDK_TOKEN"];
...
}
Add the following code snippet to the android/app/src/main/java/.../MainApplication.kt
file.
import co.ab180.airbridge.reactnative.AirbridgeRN;
...
override fun onCreate() {
super.onCreate()
AirbridgeReactNative.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
...
}
import co.ab180.airbridge.reactnative.AirbridgeRN;
...
@Override
public void onCreate() {
super.onCreate();
AirbridgeReactNative.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
...
}
Enter the configuration values to use the Airbridge React Native SDK.
{
"sdkEnabled": boolean,
"logLevel": "debug" | "info" | "warning" | "error" | "fault",
"autoStartTrackingEnabled": boolean,
"autoDetermineTrackingAuthorizationTimeoutInSecond": number,
"trackMetaDeferredAppLinkEnabled": boolean,
"sessionTimeoutInSecond": number,
"metaInstallReferrerAppID": string,
"trackAirbridgeDeeplinkOnlyEnabled": boolean,
"trackInSessionLifecycleEventEnabled": boolean,
"hashUserInformationEnabled": boolean,
"sdkSignatureID": string,
"sdkSignatureSecret": string,
"clearEventBufferOnInitializeEnabled": boolean,
"eventBufferCountLimit": number,
"eventBufferSizeLimitInGibibyte": number,
"eventTransmitIntervalInSecond": number,
}
1. Create an airbridge.json file at the top level of the React Native project folder and input the JSON as above.
2. Don't enter the key values for settings that are not needed.
Refer to the guides listed below for the settings values.
Value | Reference |
---|---|
sdkEnabled | |
logLevel | |
autoStartTrackingEnabled | |
autoDetermineTrackingAuthorizationTimeoutInSecond | |
trackMetaDeferredAppLinkEnabled | |
sessionTimeoutInSecond | |
metaInstallReferrerAppID | |
trackAirbridgeDeeplinkOnlyEnabled | |
trackInSessionLifecycleEventEnabled | |
hashUserInformationEnabled | |
sdkSignatureID | |
sdkSignatureSecret | |
clearEventBufferOnInitializeEnabled | |
eventBufferCountLimit | |
eventBufferSizeLimitInGibibyte | |
eventTransmitIntervalInSecond |
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 have allowed tracking of information through the AppTrackingTransparency (ATT) prompt.
Event collection should be delayed until the user allows tracking. If the install event is collected before the user allows tracking on 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 React Native 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.
The autoDetermineTrackingAuthorizationTimeout
function can be used to set a longer delay for collecting install events. The default setting for the autoDetermineTrackingAuthorizationTimeout
is 300 seconds. It can be set up to 3600 seconds (1 hour).
Attention
Sufficient time must be configured to delay the collection of install events. If the delay time is up, the SDK will collect install events without identifiers before users can allow tracking on the ATT prompt.
Attention
The instructions below are optional. Proceed only if necessary.
The Opt-in policy requires user consent before using user data.
After setting the autoStartTrackingEnabled
to false
, call the startTracking
function at the point of time when you can collect events. From the moment the startTracking
function is called, the SDK will start collecting events.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.startTracking()
Attention
The instructions below are optional. Proceed only if necessary.
The opt-out policy allows the use of user information until the user explicitly declines.
After setting the autoStartTrackingEnabled
to true
, call the stopTracking
function at the point of time when you can no longer collect events. From the time the stopTracking
function is called, the SDK will stop collecting events.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.startTracking()
Attention
The instructions below are optional. Proceed only if necessary.
With the SDK Signature, you can ensure SDK spoofing prevention and use verified events for ad performance measurement.
For the SDK Signature setup, the SDK Signature Credentials are required, which includes the Secret ID and the Secret. The required SDK Signature Credentials can be found in the Airbridge dashboard. For more details about the SDK Signature Credentials, refer to this Airbridge guide.
1. Enter the sdkSignatureID
listed in the Configure SDK section.
2. Enter the sdkSignatureSecret
listed in the Configure SDK section.
The information required for the setup is as follows.
sdkSignatureID
: Signature Secret ID. Navigate to [Management]>[Fraud Validation Rules]>[SDK Signature] in the Airbridge dashboard to find it.
sdkSignatureSecret
: Signature Secret. Navigate to [Management]>[Fraud Validation Rules]>[SDK Signature] in the Airbridge dashboard to find it.
By setting up a deep link, you can redirect users who click on ads with tracking links to specific pages of the desired app. Based on the information collected through the tracking link, you can also track the ad performance results in Airbridge.
When Airbridge generates a tracking link, it automatically selects and utilizes the optimal Airbridge deep link, depending on the environment. This link will be used for user redirection, and it is called the scheme deep link.
Example)
Airbridge Deep link: https://YOUR_APP_NAME.airbridge.io/~~~
Scheme Deep link: YOUR_SCHEME://product/12345
When the app is installed on a device and the user clicks the tracking link, the app opens through the Airbridge deep link. The Airbridge SDK converts the Airbridge deep link into a scheme deep link set on the tracking link. The converted scheme deep link is sent to the app.
When the app is not installed on a device and the user clicks the tracking link, the Airbridge deep link is saved. After the user moves to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge deep link into a scheme deep link. The converted scheme deep link is sent to the app.
For the deep link setup, the deep link information you entered into the Airbridge dashboard and the app page address to redirect users are required.
First, enter the deep link information into the Airbridge dashboard.
For the deep linking setup, the following information must be entered into the Airbridge dashboard.
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 URI scheme: The Airbridge deep link is converted to a schema 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 enter the above information into the Airbridge dashboard.
1. Go 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
, you enter it as demo://
.
3. In the Apple Developer Dashboard, go 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
.
1. Go 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
, you must enter it as 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.
keytool -list -v -keystore YOUR_KEYSTORE.keystore
Find the SHA256 value in the results. The SHA256 value is the sha256_cert_fingerprints.
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.
Configure the app to launch with an Airbridge deep link when the user clicks on a tracking link.
1. To set up the scheme deep link to your app, go to [YOUR_PROJECT]>[Info]>[URL Types] in Xcode.
2. Click + and enter the iOS URI scheme you submitted in the Airbridge dashboard in the URL Schemes field.
Attention
When entering the iOS URL scheme, exclude
://
.
3. To set up the universal link to your app, go 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 Airbridge 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 thisarticle for more details.
1. To set up the scheme deep link to your app, 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 entered into the Airbridge dashboard.
<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
When entering the Android URI Scheme, exclude
://
.
2. To set up the App Links to your app, add an intent filter under the Activity that handles the deep link in the AndroidManifest.xml
.
YOUR_APP_NAME
is the Airbridge app name.
<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>
The Airbridge.trackDeeplink function at the top of the OS callback should be called to pass the deep link events to the Airbridge SDK.
Add the following code snippet to the ios/YOUR_PROJECT_NAME/AppDelegate.m
file.
#import <AirbridgeReactNative/AirbridgeReactNative.h>
...
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[AirbridgeReactNative 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
[AirbridgeReactNative trackDeeplinkWithUserActivity:userActivity];
return YES;
}
import AirbridgeReactNative
...
// when app is opened with scheme deeplink
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
AirbridgeReactNative.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
AirbridgeReactNative.trackDeeplink(userActivity: userActivity)
return true
}
Add the following code snippet to the android/app/src/main/java/.../MainActivity.kt
file.
import co.ab180.airbridge.reactnative.AirbridgeReactNative
...
override fun onResume() {
super.onResume()
AirbridgeReactNative.trackDeeplink(intent)
}
...
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
setIntent(intent)
}
import co.ab180.airbridge.reactnative.AirbridgeReactNative;
...
@Override
protected void onResume() {
super.onResume();
AirbridgeReactNative.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.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.setOnDeeplinkReceived((url) => {
// show proper content using url
})
When a user clicks on a tracking link with deferred deep linking capabilities and your app is not installed on the device, the Airbridge SDK retrieves the deep link as follows.
The Airbridge SDK attempts to retrieve a deep link after initializing the SDK when all the following conditions are met. If the app is closed during retrieval, 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.
The Airbridge SDK collects user actions from the app as per settings and sends them as in-app events.
Setting up a Hybrid App
In the hybrid app, you can set the React Native SDK to handle Airbridge related tasks occurring on the in-app website without changing the website code.
Call the Airbridge.trackEvent
function to send events. Refer to the information below about the required Airbridge.trackEvent
function components and their types.
static trackEvent(
category: string,
): void
static trackEvent(
category: string,
semanticAttributes: Record<string, any>,
): void
static trackEvent(
category: string,
semanticAttributes: Record<string, any>,
customAttributes: Record<string, any>,
): void
Component | Required or Optional | 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 event |
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.
import { Airbridge, AirbridgeCategory } from 'airbridge-react-native-sdk'
...
// 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.
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbidge-react-native-sdk'
...
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 | Type | Value |
---|---|---|
SIGN_UP | string | airbridge.user.signup |
SIGN_IN | string | airbridge.user.signin |
SIGN_OUT | string | airbridge.user.signout |
HOME_VIEWED | string | airbridge.ecommerce.home.viewed |
PRODUCT_LIST_VIEWED | string | airbridge.ecommerce.productList.viewed |
SEARCH_RESULTS_VIEWED | string | airbridge.ecommerce.searchResults.viewed |
PRODUCT_VIEWED | string | airbridge.ecommerce.product.viewed |
ADD_PAYMENT_INFO | string | airbridge.addPaymentInfo |
ADD_TO_WISHLIST | string | airbridge.addToWishlist |
ADDED_TO_CART | string | airbridge.ecommerce.product.addedToCart |
INITIATE_CHECKOUT | string | airbridge.initiateCheckout |
ORDER_COMPLETED | string | airbridge.ecommerce.order.completed |
ORDER_CANCELED | string | airbridge.ecommerce.order.canceled |
START_TRIAL | string | airbridge.startTrial |
SUBSCRIBE | string | airbridge.subscribe |
UNSUBSCRIBE | string | airbridge.unsubscribe |
AD_IMPRESSION | string | airbridge.adImpression |
AD_CLICK | string | airbridge.adClick |
COMPLETE_TUTORIAL | string | airbridge.completeTutorial |
ACHIEVE_LEVEL | string | airbridge.achieveLevel |
UNLOCK_ACHIEVEMENT | string | airbridge.unlockAchievement |
RATE | string | airbridge.rate |
SHARE | string | airbridge.share |
SCHEDULE | string | airbridge.schedule |
SPEND_CREDITS | string | airbridge.spendCredits |
Key | Type | Value |
---|---|---|
ACTION | string | action |
LABEL | string | label |
VALUE | string | value |
CURRENCY | string | currency |
ORIGINAL_CURRENCY | string | originalCurrency |
PRODUCTS | string | products |
PRODUCT_ID | string | productID |
PRODUCT_NAME | string | name |
PRODUCT_PRICE | string | price |
PRODUCT_QUANTITY | string | quantity |
PRODUCT_CURRENCY | string | currency |
PRODUCT_POSITION | string | position |
PRODUCT_CATEGORY_ID | string | categoryID |
PRODUCT_CATEGORY_NAME | string | categoryName |
PRODUCT_BRAND_ID | string | brandID |
PRODUCT_BRAND_NAME | string | brandName |
PERIOD | string | period |
IS_RENEWAL | string | isRenewal |
RENEWAL_COUNT | string | renewalCount |
PRODUCT_LIST_ID | string | productListID |
CART_ID | string | cartID |
TRANSACTION_ID | string | transactionID |
TRANSACTION_TYPE | string | transactionType |
TRANSACTION_PAIRED_EVENT_CATEGORY | string | transactionPairedEventCategory |
TRANSACTION_PAIRED_EVENT_TIMESTAMP | string | transactionPairedEventTimestamp |
TOTAL_QUANTITY | string | totalQuantity |
QUERY | string | query |
IN_APP_PURCHASED | string | inAppPurchased |
CONTRIBUTION_MARGIN | string | contributionMargin |
ORIGINAL_CONTRIBUTION_MARGIN | string | originalContributionMargin |
LIST_ID | string | listID |
RATE_ID | string | rateID |
RATE | string | rate |
MAX_RATE | string | maxRate |
ACHIEVEMENT_ID | string | achievementID |
SHARED_CHANNEL | string | sharedChannel |
DATE_TIME | string | datetime |
DESCRIPTION | string | description |
IS_REVENUE | string | isRevenue |
PLACE | string | place |
SCHEDULE_ID | string | scheduleID |
TYPE | string | type |
LEVEL | string | level |
SCORE | string | score |
AD_PARTNERS | string | adPartners |
IS_FIRST_PER_USER | string | isFirstPerUser |
Refer to the example codes for each data type below.
import { Airbridge, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
'event',
{
[AirbridgeAttribute.VALUE]: 10,
},
{
'string': 'string',
'number': 1000,
'boolean': true,
'object': {'key': 'value'},
'array': ['value'],
},
)
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 supports events triggered by users on a session basis. A session ends if any of the following conditions are met.
The app moves to the background, or the app is terminated
The session expires with the app being in the foreground
When the app is launched, or an event is performed after the end of a session, a new session is initiated.
The default session timeout is set to 300 seconds. Use the setSessionTimeout
function to modify this value to a maximum of 604,800 seconds (7 days).
Attention
The Airbridge SDK collects Open events that initiate a new session and Foreground events. It does not collect these events during a session. To collect them while the session is being maintained, additional settings are required.
The Airbridge SDK maintains a queue of collected events and transmits them until the queue is empty.
If event transmission fails, transmission is attempted again after waiting for 1, 2, 4, ... seconds, depending on the number of times it failed. If the transmission continues to fail, the SDK waits for the set event transmission interval and repeats loading events until successful.
The default transmission interval is 0 seconds. Using the setEventTransmitInterval
function, you can modify it up to 86,400 seconds (1 day).
The Airbridge SDK stores events as long as they don't exceed the maximum event count and size limits. Excess events are discarded.
The default maximum event count is set to INT_MAX, and the default maximum event size is 1024 GiB (gibibytes). You can adjust these settings using the setEventBufferCountLimit
function and setEventBufferSizeLimit
function. The highest allowable event count is INT_MAX, and the highest maximum event size you can set is 1024 GiB (gibibytes).
When the event deletion option is activated, all in-app events that are not transmitted during the initialization process of the Airbridge SDK are deleted. By default, the event deletion option is inactive.
By setting the setClearEventBufferOnInitializeEnabled
function to true
, the event deletion option is activated.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_TOKEN")
.setClearEventBufferOnInitializeEnabled(true)
.build()
Airbridge.initializeSDK(option: option)
#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 in all events for transmission.
#{"width": "140px"} Function | #{"width": "240px"} Description |
---|---|
| Adds additional device identifiers. Up to 10 identifiers can be entered. |
| Deletes only specified device identifiers. |
| Deletes all device identifiers. |
Refer to the example below.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.setDeviceAlias('string', 'string')
Airbridge.removeDeviceAlias('string')
Airbridge.clearDeviceAlias()
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.
import { Airbridge, AirbridgeCategory } from 'airbridge-react-native-sdk'
...
Airbridge.setUserID('string')
Airbridge.setUserAlias('string', 'string')
Airbridge.setUserEmail('string')
Airbridge.setUserPhone('string')
Airbridge.setUserAttribute('string', 'string')
Airbridge.trackEvent(
AirbridgeCategory.SIGN_UP,
)
import { Airbridge, AirbridgeCategory } from 'airbridge-react-native-sdk'
...
Airbridge.setUserID('string')
Airbridge.setUserAlias('string', 'string')
Airbridge.setUserEmail('string')
Airbridge.setUserPhone('string')
Airbridge.setUserAttribute('string', 'string')
Airbridge.trackEvent(
AirbridgeCategory.SIGN_IN,
)
import { Airbridge, AirbridgeCategory } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.SIGN_OUT,
)
Airbridge.clearUser()
import { Airbridge, AirbridgeCategory } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.HOME_VIEWED,
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.PRODUCT_LIST_VIEWED,
{
[AirbridgeAttribute.LIST_ID]: '84e6e236-38c4-48db-9b49-16e4cc064386',
[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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.SEARCH_RESULTS_VIEWED,
{
[AirbridgeAttribute.QUERY]: 'Plastic',
[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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.PRODUCT_VIEWED,
{
[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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.ADD_PAYMENT_INFO,
{
[AirbridgeAttribute.TYPE]: 'CreditCard',
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
},
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
},
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.COMPLETE_TUTORIAL,
{
[AirbridgeAttribute.DESCRIPTION]: 'Finish Initial Tutorial',
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.ACHIEVE_LEVEL,
{
[AirbridgeAttribute.LEVEL]: 13,
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.UNLOCK_ACHIEVEMENT,
{
[AirbridgeAttribute.ACHIEVEMENT_ID]: '36a0f0bb-b153-4be1-a3e0-3cb5b2b076c1',
[AirbridgeAttribute.DESCRIPTION]: 'Get Score Over 50',
[AirbridgeAttribute.SCORE]: 80,
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.RATE,
{
[AirbridgeAttribute.RATE_ID]: '531c64b3-4704-4780-a306-89014ec18daf',
[AirbridgeAttribute.RATE]: 4.5,
[AirbridgeAttribute.MAX_RATE]: 5,
[AirbridgeAttribute.PRODUCTS]: [
{
[AirbridgeAttribute.PRODUCT_ID]: '0117b32a-5a6c-4d4c-b64c-7858e07dba78',
[AirbridgeAttribute.PRODUCT_NAME]: 'PlasticHammer',
[AirbridgeAttribute.PRODUCT_PRICE]: 10,
[AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.SHARE,
{
[AirbridgeAttribute.DESCRIPTION]: 'Share Promotion',
[AirbridgeAttribute.SHARED_CHANNEL]: 'CopyLink',
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
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',
},
],
},
)
import { Airbridge, AirbridgeCategory, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
AirbridgeCategory.SPEND_CREDITS,
{
[AirbridgeAttribute.TRANSACTION_ID]: '22eb193d-be11-4fe4-95da-c91a196faf1c',
[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.
import { Airbridge, AirbridgeAttribute } from 'airbridge-react-native-sdk'
...
Airbridge.trackEvent(
'event',
{
[AirbridgeAttribute.VALUE]: 10,
},
{
'string': 'string',
'number': 1000,
'boolean': true,
'object': {'key': 'value'},
'array': ['value'],
},
)
Airbridge sends user data along with events. User data allows for a more accurate ad performance measurement.
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.
Function |
Description |
---|---|
| Inputs the user ID. |
| Deletes the user ID. |
| Adds additional user identifiers. Up to 10 items can be added. |
| Deletes only specified identifiers. |
| Deletes all additional user identifiers. |
Refer to the example below.
import { Airbridge } from 'airbridge-react-native-sdk'
...
// identifier
Airbridge.setUserID('string')
Airbridge.clearUserID()
// addtional identifier
Airbridge.setUserAlias('string', 'string')
Airbridge.removeUserAlias('string')
Airbridge.clearUserAlias()
Attention
Sensitive user information may be included. Send after a thorough review with a legal advisor.
Send additional user information by setting user attributes.
Function |
Description |
---|---|
| Inputs user's email. The data is hashed using SHA256. |
| Deletes the user email. |
| Inputs user's phone number. The data is hashed using SHA256. |
| Deletes the user's phone number. |
| Adds additional user attributes. Up to 100 items can be added. - key: Up to 128 characters. Must satisfy the regular expression: - value: Only supports string, number, and Boolean types. Up to 1024 characters. |
| Deletes only specified attributes from the additional attributes. |
| Deletes all additional user attributes. |
Refer to the example below.
import { Airbridge } from 'airbridge-react-native-sdk'
...
// 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()
When the Airbridge.setHashUserInformationEnabled
function is set to false
, user emails and phone numbers are transmitted without being hashed. The default setting is true
.
You can reset user information with the Airbridge.clearUser
function.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.clearUser()
Follow the instructions below for additional setup.
Attention
The instructions below are optional. Proceed only if necessary.
Depending on how the link is opened, it may be difficult to properly use the tracking link of the app in-app.
By using the Airbridge.click
function or the Airbridge.impression
function, you can properly use the tracking link without going through 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.
import Airbridge
...
let isHandled = Airbridge.click(trackingLink: url) {
// when url is tracking link and succeed
} onFailure: { error in
// 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
}
#import <Airbridge/Airbridge.h>
...
BOOL isHandled = [Airbridge clickWithTrackingLink:url onSuccess:^{
// when url is tracking link and succeed
} onFailure:^(NSError * _Nonnull) {
// 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.
import Airbridge
...
let isHandled = Airbridge.impression(trackingLink: url) {
// when url is tracking link and succeed
} onFailure: { error in
// when url is tracking link and failed
}
if !isHandled {
// when url is not tracking link
}
#import <Airbridge/Airbridge.h>
...
BOOL isHandled = [Airbridge impressionWithTrackingLink:url onSuccess:^{
// when url is tracking link and succeed
} onFailure:^(NSError * _Nonnull) {
// when url is tracking link and failed
}];
if (!isHandled) {
// when url is not tracking link
}
Attention
When you set up Airbridge SDK to use tracking links within apps, every time a tracking link is used in 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 default attribution window settings for Deeplink Pageviews is 3 days. If you want to change the attribution window for Deeplink Pageviews, contact the Airbridge CSM. If you don't have a designated CSM, click here to contact us.
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 setOnAttributionReceived
function to get the attribution data of install events.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.setOnAttributionReceived((attribution) => {
// when attribution is received
})
The value is delivered as follows, depending on the existence of attribution results.
If the attribution result exists, a dictionary including the values below will be passed as a callback. All keys provide the attribution data. For example, attributedChannel
contains information about the ad channel the ad performance is attributed to.
Attribution results are delivered as a callback within 1 minute after SDK initialization. Any previous attribution results not delivered due to app termination will be delivered as a callback within 1 minute at the next app launch. Depending on the network environment, it can be delayed 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 dictionary below will be transferred via callback. The information about the lack of attribution results will only be sent when the app is launched at least 3 hours after the SDK initialization.
{
"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.
Add the following code to the ios/YOUR_PROJECT_NAME/AppDelegate.m
file.
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)
}
}
#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];
}
}
No setup is required as the events are automatically collected on Android.
The Airbridge SDK collects all types of deep link events regardless of the service that created the deep link. If deep link events are excessively collected, you can set the setTrackAirbridgeDeeplinkOnlyEnabled
function to true
so that only Airbridge deep links are collected.
SDK collects Open, Foreground events when a new session is started. It does not collect these events while the session is continued.
By setting the trackInSessionLifecycleEventEnabled
of Configure SDK to true, SDK collects Open, Foreground events while the session is continued.
All collected foreground events are recorded as open events.
To comply with the Digital Markets Act (DMA), you must pass User Response Information (User Consent) to Airbridge. For more information about the DMA and who it applies to, see the Airbridge guide.
If you are in the European Economic Area (EEA), you must always pass User Consent information to Airbridge.
1. Determine the user's region from which they launched your app. If the user launched the app from the EEA(eea=1
), check to see if you already have user response information. If you have collected user response information, proceed to step 3.
If the user launched the app from outside the EEA, you do not need to collect user response information.
Note
Airbridge cannot provide guidance on storing the user response data and implementing the prompts. For assistance, consult legal professionals.
2. If you don't have any user response information collected, collect user response information from prompts, etc. The information you need to collect in this step is adPersonalization
, adUserData
.
Attention
Advertisers must collect user consent data from all existing and new users in the EEA region at least once starting March 6, 2024.
The table below illustrates the consent data that must be sent to Airbridge. The eea
value is neither a direct response from the user nor automatically filled in by Airbridge. Advertisers should determine the eea
value based on whether the user is in the EEA and the DMA applies or not.
Field Name in Airbridge |
Field Name in Google |
Description |
---|---|---|
<string> |
| Indicates whether the user is in the EEA and the DMA applies or not. The value is neither a direct response from the user nor automatically filled in by Airbridge. Determine the appropriate value based on whether the user is located and whether the DMA applies or not. Values other than - - |
<string> |
| Indicates whether the user gave Google consent to use their data for ad personalization. Values other than - - |
<string> |
| Indicates whether the user gave consent to send their data to Google for ad-related purposes. Values other than - - |
3. Set the autoStartTrackingEnabled
of Configure SDK to false.
4. Initialize the Airbridge SDK and pass user response information to the Airbridge before collecting user information.
Attention
Pay attention to the following.
Use the field names specified by Airbridge:
eea
,adPersonalization
, andadUserData
.Fill in
0
or1
in accordance with the consent data collected.
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')
// start tracking explicitly
Airbridge.startTracking()
Attention
If you have set up the Meta Deferred App Link, Facebook SDK's
fetchDeferredAppLink
function should not be used.
You can use deferred deep linking in Meta ads in the following way. The Airbridge SDK collects the Meta deferred app links first above others. If there are no Meta deferred app links, Airbridge deferred deep links are collected.
Meta does not support Meta deferred app links for SKAdNetwork campaigns.
1. Install the Facebook SDK. See the Meta guide.
2. Set the setTrackMetaDeferredAppLinkEnabled
function in the Airbridge SDK to true
.
Attention
If the Airbridge SDK is not activated immediately after initialization, the Install, Open, Deep link events may not be collected.
Initializing the Airbridge SDK activates all features. You can initialize the Airbridge SDK with all features deactivated by setting the setSDKEnabled
function to false
.
You can also check the activation status of the Airbridge SDK in the following way and activate or deactivate all functions.
import { Airbridge } from 'airbridge-react-native-sdk'
...
Airbridge.isSDKEnabled()
Airbridge.enableSDK()
Airbridge.disableSDK()
Send the Meta App ID to the metaInstallReferrer
during the SDK initialization stage.
After the setup, you need to enter the decryption key into the Airbridge dashboard to view the decrypted Meta Install Referrer. Refer to the Airbridge guide for how to enter the decryption key.
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 methods and explanations.
Additional SDK setup is required to integrate with some third-party solutions. It is recommended to complete the necessary setup for integrating with third-party solutions before collecting data with the Airbridge SDK.
Refer to the articles listed below for integrating with third-party solutions.
The Airbridge SDK logs are provided in different levels: Debug, Info, Warning, Error, and Fault, with the Debug level being the least critical log and Fault the most critical.
The Airbridge SDK provides logs at Warning, Error, and Fault levels by default. By inputting a log level into the setLogLevel
function, you can view logs from that level up to the Fault level.
Was this page helpful?