Attention
This guide provides instructions for installing and setting up the Flutter SDK v4. For earlier versions, consult the Flutter SDK (Previous) guide.
Install the Airbridge iOS SDK and implement the necessary settings following the steps below.
The Airbridge Flutter SDK can be installed using the method below. After installation, you can verify whether the SDK has been properly installed through a Flutter SDK Test.
Add the following code to the dependencies
block in the pubspec.yaml
file.
dependencies:
# Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk/versions
airbridge_flutter_sdk: HERE_LATEST_VERSION
Open the Terminal
at the location of the top-level file of the relevant project and execute the command below. Note that the Airbridge Flutter SDK only works on Flutter 1.20.0 and later and on Dart 2.12.0 and later.
flutter pub get
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.
dependencies:
# Get the latest version from https://pub.dev/packages/airbridge_flutter_sdk_restricted/versions
airbridge_flutter_sdk_restricted: HERE_LATEST_VERSION
Add the following line to the dependencies
block in the pubspec.yaml
file.
Open the Terminal
at the location of the top-level file of the relevant project and execute the command below.
flutter pub get
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 to the ios/YOUR_PROJECT_NAME/AppDelegate.m
file.
import airbridge_flutter_sdk
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
AirbridgeFlutter.initializeSDK(appName: "YOUR_APP_NAME", appToken: "YOUR_APP_SDK_TOKEN")
}
#import <airbridge_flutter_sdk/AirbridgeFlutter.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AirbridgeFlutter initializeSDKWithAppName:@"YOUR_APP_NAME" appToken:@"YOUR_APP_SDK_TOKEN"];
}
If an Application class is not defined in the android module of the project, create an Application class.
Add the following code to the android/app/src/main/java/.../MainApplication.kt
file.
import co.ab180.airbridge.flutter.AirbridgeFlutter
import io.flutter.app.FlutterApplication
class MainApplication: FlutterApplication() {
override fun onCreate() {
super.onCreate()
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
}
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
import io.flutter.app.FlutterApplication;
public class MainApplication extends FlutterApplication {
@Override
public void onCreate() {
super.onCreate();
AirbridgeFlutter.initializeSDK(this, "YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN");
}
}
Register the Application class you created earlier in the AndroidManifest.xml
of the android module of the project as follows.
<application
android:name=".MainApplication"
...>
...
</application>
Complete the necessary configurations to use the Airbridge Flutter 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,
"isHandleAirbridgeDeeplinkOnly" : boolean
}
Create an airbridge.json file at the top level of the Flutter project folder and input the JSON as above.
Don't input values for functions that are not needed.
For detailed guidance on the individual functions, refer to the links below.
Value | Reference |
---|---|
sdkEnabled | |
logLevel | |
autoStartTrackingEnabled | |
autoDetermineTrackingAuthorizationTimeoutInSecond | |
trackMetaDeferredAppLinkEnabled | |
sessionTimeoutInSecond | |
metaInstallReferrerAppID | |
trackAirbridgeDeeplinkOnlyEnabled | |
trackInSessionLifecycleEventEnabled | |
hashUserInformationEnabled | |
sdkSignatureID | |
sdkSignatureSecret | |
clearEventBufferOnInitializeEnabled | |
eventBufferCountLimit | |
eventBufferSizeLimitInGibibyte | |
eventTransmitIntervalInSecond | |
isHandleAirbridgeDeeplinkOnly |
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 AppTrackingTransparency (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.
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. When the startTracking
function is called, the SDK will start collecting events.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
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. When the stopTracking
function is called, the SDK will stop collecting events.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.stopTracking();
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.
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 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 linking setup, the following information is required.
Deep link information submitted in the Airbridge dashboard
App page address for user redirection
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>
Pass deep link events to the Airbridge SDK for collection. Call the Airbridge.trackDeeplink
function at the top of the OS callback that is called when the app is opened with a deep link.
Please add the following code to the ios/YOUR_PROJECT_NAME/AppDelegate.m
file.
#import <airbridge_flutter_sdk/AirbridgeFlutter.h>
...
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[AirbridgeFlutter 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
[AirbridgeFlutter trackDeeplinkWithUserActivity:userActivity];
return YES;
}
import airbridge_flutter_sdk
...
// when app is opened with scheme deeplink
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
AirbridgeFlutter.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
AirbridgeFlutter.trackDeeplink(userActivity: userActivity)
return true
}
Please add the following code to the android/app/src/main/java/.../MainApplication.kt
file.
import co.ab180.airbridge.flutter.AirbridgeFlutter
import android.content.Intent
...
override fun onResume() {
super.onResume()
AirbridgeFlutter.trackDeeplink(intent)
}
...
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}
import co.ab180.airbridge.flutter.AirbridgeFlutter;
import android.content.Intent;
...
@Override
protected void onResume() {
super.onResume();
AirbridgeFlutter.trackDeeplink(intent);
}
...
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
When the Airbridge deep link is executed, it is converted into a scheme deep link and passed to the OnDeeplinkReceived callback. And if a deep link that is not an Airbridge deeplink is executed, it is directly passed to the callback.
The collected deep link is used to redirect the user to the configured destination.
Airbridge.setOnDeeplinkReceived((deeplink) {
// show proper content using url
});
If you want to collect the Airbridge deep links only, set isHandleAirbridgeDeeplinkOnly
to true
and receive only the Airbridge deep links through a callback. For more information, refer to this section.
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 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 settings are required.
The Airbridge SDK collects user actions from the app as per settings and sends them as in-app events.
SDK setup for hybrid apps
You can set up the Android SDK to handle Airbridge-related tasks within the in-app website without changing the website's code for your hybrid app.
Call the Airbridge.trackEvent
function to send events. Refer to the information below about the required Airbridge.trackEvent
function components and their types.
static void trackEvent({
required String category,
Map<String, dynamic>? semanticAttributes,
Map<String, dynamic>? customAttributes
})
Component | Required | Type | Description |
---|---|---|---|
category | Required | String | Event name |
semanticAttributes | Optional | Map<String, dynamic> | Semantic attributes of the events |
customAttributes | Optional | Map<String, dynamic> | 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 name set in the event taxonomy.
Refer to the example below.
// track standard event (provided by sdk)
Airbridge.trackEvent(category: AirbridgeCategory.ORDER_COMPLETED);
// track standard event (not provided by sdk)
Airbridge.trackEvent(category: "airbridge.ecommerce.order.canceled");
// track custom event
Airbridge.trackEvent(category: "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.
The semantic attributes predefined by Airbridge can be found in the user guide below.
Refer to the example below.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
Airbridge.trackEvent(
category: AirbridgeCategory.ORDER_COMPLETED,
semanticAttributes: {
// 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,
},
customAttributes: {
// custom attribute
'promotion': 'FirstPurchasePromotion',
},
);
Attention
Semantic attributes and custom attributes only allow JSON as a data type.
JSON types: String, Number, Boolean, Object<String, JSON>, Array<JSON>
Types that cannot be used in semantic attributes and custom attributes: Struct, 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 type of data below.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
Airbridge.trackEvent(
category: AirbridgeCategory.ORDER_COMPLETED,
semanticAttributes: {
// 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,
},
customAttributes: {
// custom attribute
'promotion': 'FirstPurchasePromotion',
},
);
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 can be entered. - Key: Maximum 128 characters. It must satisfy the regular expression - Value: Maximum 128 characters. |
| Deletes the specified device identifier from among the device identifiers. |
| Deletes all device identifiers. |
Refer to the example below.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.setUserID('string');
Airbridge.setUserAlias(key: 'string', value: 'string');
Airbridge.setUserEmail('string');
Airbridge.setUserPhone('string');
Airbridge.setUserAttribute(key: 'string', value: 'string');
Airbridge.trackEvent(
category: AirbridgeCategory.SIGN_UP,
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.setUserID('string');
Airbridge.setUserAlias(key: 'string', value: 'string');
Airbridge.setUserEmail('string');
Airbridge.setUserPhone('string');
Airbridge.setUserAttribute(key: 'string', value: 'string');
Airbridge.trackEvent(
category: AirbridgeCategory.SIGN_IN,
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.SIGN_OUT,
);
Airbridge.clearUser();
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.HOME_VIEWED,
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.PRODUCT_LIST_VIEWED,
semanticAttributes:
{
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.SEARCH_RESULTS_VIEWED,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.PRODUCT_VIEWED,
semanticAttributes: {
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',
},
],
},
)
Airbridge.trackEvent(
AirbridgeCategory.ADD_PAYMENT_INFO,
mapOf(
AirbridgeAttribute.TYPE to "CreditCard",
)
)
Airbridge.trackEvent(
AirbridgeCategory.ADD_PAYMENT_INFO,
new HashMap() {{
put(AirbridgeAttribute.TYPE, "CreditCard");
}}
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.ADD_PAYMENT_INFO,
semanticAttributes:
{
AirbridgeAttribute.TYPE: 'CreditCard'
}
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.ADDED_TO_CART,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.INITIATE_CHECKOUT,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.ORDER_COMPLETED,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.ORDER_CANCELED,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.START_TRIAL,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.SUBSCRIBE,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.UNSUBSCRIBE,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.AD_IMPRESSION,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.AD_CLICK,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.COMPLETE_TUTORIAL,
semanticAttributes: {
AirbridgeAttribute.DESCRIPTION: 'Finish Initial Tutorial',
},
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.ACHIEVE_LEVEL,
semanticAttributes: {
AirbridgeAttribute.LEVEL: 13,
},
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.UNLOCK_ACHIEVEMENT,
semanticAttributes: {
AirbridgeAttribute.ACHIEVEMENT_ID: '36a0f0bb-b153-4be1-a3e0-3cb5b2b076c1',
AirbridgeAttribute.DESCRIPTION: 'Get Score Over 50',
AirbridgeAttribute.SCORE: 80,
},
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.RATE,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.SHARE,
semanticAttributes: {
AirbridgeAttribute.DESCRIPTION: 'Share Promotion',
AirbridgeAttribute.SHARED_CHANNEL: 'CopyLink',
},
);
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.SCHEDULE,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: AirbridgeCategory.SPEND_CREDITS,
semanticAttributes: {
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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.trackEvent(
category: 'event',
semanticAttributes: {
AirbridgeAttribute.VALUE: 10,
},
customAttributes: {
'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. |
| Delete 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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
// identifier
Airbridge.setUserID('string');
Airbridge.clearUserID();
// addtional identifier
Airbridge.setUserAlias(key: 'string', value: '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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
// email, phone
Airbridge.setUserEmail('string');
Airbridge.clearUserEmail();
Airbridge.setUserPhone('string');
Airbridge.clearUserPhone();
// addtional attribute
Airbridge.setUserAttribute(key: 'string', value: 'string');
Airbridge.setUserAttribute(key: 'number', value: 1000);
Airbridge.removeUserAttribute('string');
Airbridge.clearUserAttributes();
When the hashUserInformationEnabled
function is set to false
, user emails and phone numbers are passed without being hashed. The default setting is true
.
You can reset user information with the Airbridge.clearUser
function.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.clearUser();
Follow the instructions below for additional setup.
Attention
The instructions below are optional. Proceed only if necessary.
Note
The Airbridge Flutter SDK must be v4.1.2 or later.
The deep links received through the setOnDeeplinkReceived
method of the AirbridgeFlutter SDK include not only Airbridge deep links but also deep links from other solutions.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.setOnDeeplinkReceived((url) => {
// show proper content using url
})
If you set isHandleAirbridgeDeeplinkOnly
to true
, only Airbridge deep links will be delivered through the setOnDeeplinkReceived
callback. If you are using deep links from different solutions, you can handle the deep links separately.
Depending on the method of opening the link, 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 within 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 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
const isHandled = Airbridge.click(
trackingLink: url,
onSuccess: () {
// when url is tracking link and succeed
},
onFailure: (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.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
const isHandled = Airbridge.impression(
trackingLink: url,
onSuccess: () {
// when url is tracking link and succeed
},
onFailure: (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
如果在 Airbridge iOS SDK 1.24.0 及以上版本的 App 中使用追踪链接,将记录 “深度链接页面浏览(Deeplink Pageview)” 目标事件(Target Event)。如果深度链接页面浏览频繁随后深度链接打开(Deeplink Open)发生,可能会影响深度链接打开的绩效。
深度链接页面浏览的的默认归因窗口为 3 天。如果希望更改此归因窗口,请联系您的 CSM。
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.
Airbridge.setAttributionListener((result) {
// do something
});
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 as a 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 delivered as a callback within 1 minute after SDK initialization. If the app is closed before the attribution result is delivered, the previous attribution results will be delivered as a 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 as a callback. For this data to be delivered, the app must be launched again 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 trackAirbridgeDeeplinkOnlyEnabled
function to true
so that only Airbridge deep links are collected.
The Airbridge SDK collects Open and Foreground events that initiate a new session. These events are not collected during an ongoing session.
By setting the trackInSessionLifecycleEventEnabled
function to true
, you can collect Open and Foreground events during ongoing sessions.
All collected Foreground events are recorded as Open events.
To comply with the Digital Markets Act (DMA), you must pass user consent data to Airbridge. For more information about the DMA and whether it applies to your service, see the Airbridge user guide.
If you are in the European Economic Area (EEA), you must always pass User Response information to Airbridge.
1. Confirm whether the end user launched the app in the EEA. If the end user did launch the app in the EEA (eea=1
), confirm whether the consent values are already stored for the session. If there are consent values stored, continue to Step 3.
If the user launched the app from outside the EEA region, you don't need to collect consent data.
提示
Airbridge 无法提供有关存储用户同意信息或实现同意弹窗的指导。请咨询法律顾问。
2. IIf there are no consent values stored, proceed to obtain user consent, such as with a privacy prompt. You must collect the adPersonalization
and adUserData
values in this step.
注意
从 2024-03-06 起,必须对 EEA 的现有用户和新用户至少取得一次同意。
必须共享给 Airbridge 的用户同意信息如下。eea
值不是用户的直接响应,也不是 Airbridge 自动收集的信息。请根据用户所在地确定 eea
值并将其共享给 Airbridge。
Airbridge 字段 |
Google 字段 |
说明 |
---|---|---|
<string> |
| 表示用户是否在 EEA,或 DMA 适用地区。该值不是用户的直接响应,也不是 Airbridge 自动收集的信息。请根据用户所在地确定 不处理除 - - |
<string> |
| 对于收集信息以提供个性化广告(Personalized Ads) 的用户同意情况。不处理除 - - |
<string> |
| 对于向 Google 发送用于广告目的用户数据的同意情况。不处理除 - - |
3. Set the autoStartTrackingEnabled
function to false
.
4. Initialize the Airbridge SDK and share the consent values with Airbridge before collecting the end user’s personal data.
注意
必须为
eea
、adPersonalization
和adUserData
使用相同的名称。请根据同意情况正确输入
0
或1
。
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
// deliver informations to sdk using device alias
// based on actual region
Airbridge.setDeviceAlias(key: 'eea', value: '0' or '1');
// based on actual user consent
Airbridge.setDeviceAlias(key: 'adPersonalization', value: '0' or '1');
Airbridge.setDeviceAlias(key: 'adUserData', value: '0' or '1');
// start tracking explicitly
Airbridge.startTracking();
Follow the steps below to use deferred deep linking in Meta ads. 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.
SKAdNetwork campaigns in Meta Ads do not support meta deferred app links.
1. Refer to the Meta ads document for iOS or Meta ads document for Android and install the Facebook SDK.
2. Set the trackMetaDeferredAppLinkEnabled
function in the Airbridge SDK to true
.
Attention
If not activated immediately after the SDK initialization, the Install, Open, Deeplink events may not be collected.
When initializing the Airbridge SDK, all features are activated. By setting the sdkEnabled
function to false
, you can initialize the Airbridge SDK with all features in inactive mode.
You can also check the activation status of the Airbridge SDK in the following method and activate or deactivate all functions.
import 'package:airbridge_flutter_sdk/airbridge_flutter_sdk.dart';
...
Airbridge.isSDKEnabled();
Airbridge.enableSDK();
Airbridge.disableSDK();
This setup is required to collect the Meta Install Referrer. Send the Meta app ID to the metaInstallReferrerAppID
function in 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 this user guide to learn 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 instructions.
Additional SDK setup is required to integrate with some third-party solutions. It is recommended to complete the necessary SDK 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 logs provided by the Airbridge SDK are categorized into Debug, Info, Warning, Error, and Fault levels. Debug level is the least critical log, while Fault level is the most critical log.
By default, the Airbridge SDK provides logs at Warning, Error, and Fault levels. If you input a log level using the setLogLevel
function, you can view logs from that specified level up to the Fault level.
Was this page helpful?