Note
This guide provides instructions for installing and setting up the iOS SDK v4. For earlier versions, consult the iOS SDK (Previous) guide.
Install the Airbridge iOS SDK and implement the necessary settings following the steps below.
The Airbridge iOS SDK can be installed using the method below. After installation, you can verify whether the SDK has been properly installed through the iOS SDK Test.
1. Navigate to [File]>[Add Packages...] in Xcode.
2. Enter the following address into the search bar and click Add Package.
3. Click Add Package again.
4. The Airbridge iOS SDK will be added to Package Dependencies.
Attention
Before installing the iOS SDK, navigate to [YOUR_PROJECT]>[Build Settings] in your Xcode and make sure to set the User Script Sandboxing to "No." For more details, refer to the CocoaPods document.
1. Install CocoaPods with brew install cocoapods
.
2. Create a Podfile with pod init
.
3. Add the SDK as a dependency with the code below in the Podfile.
target '[Project Name]' do
...
# choose YOUR_VERSION from https://help.airbridge.io/developers/release-note-ios-sdk
# example: pod 'airbridge-ios-sdk', '4.X.X'
pod 'airbridge-ios-sdk', 'YOUR_VERSION'
...
end
4. The installation will start when you enter pod install --repo-update
.
5. Run YOUR_PROJECT.xcworkspace
to verify that the Airbridge iOS SDK is successfully installed.
Attention
You cannot install the Airbridge iOS SDK with Tuist's External Dependencies. Make sure to install the iOS SDK using the method below.
1. Run the tuist edit
command.
2. Add remote
to project.packages
. Add package
to project.targets[...].target.dependencies
. Refer to the code below.
import ProjectDescription
let project = Project(
packages: [
.remote(
url: "https://github.com/ab180/airbridge-ios-sdk-deployment",
// choose YOUR_VERSION from https://help.airbridge.io/developers/release-note-ios-sdk
// example: requirement: .exact(from: "4.X.X")
requirement: .exact(from: "YOUR_VERSION")
),
...
],
targets: [
.target(
dependencies: [
.package(product: "Airbridge", type: .runtime),
...
]
),
...
],
...
)
3. Run the tuist generate
command.
4. Airbridge is added to the Package Dependencies in Xcode.
1. Download the Airbridge iOS SDK from the link below.
2. Add Airbridge.xcframework to your project. Navigate to [Project File]>[General]>[Frameworks, Libraries, and Embedded Content] in Xcode and click +.
3. Click Add Files... under [Add Other...] and select Airbridge.xcframework.
4. Set the Embed of Airbridge.xcframework to "Do not Embed."
5. Add the framework corresponding to the dependency of SDK to the project. Navigate to [Project File]>[General]>[Frameworks, Libraries, and Embedded Content] in Xcode and click +.
6. Add all the frameworks below. Set the Embed of the added frameworks to "Do not Embed." Then, navigate to [Project File]>[Build Phase]>[Link Binary With Libraries] in the Xcode and set the Status to "Optional."
Framework | Description |
---|---|
AdSupport.framework | The framework used to collect IDFA. |
CoreTelephony.framework | The framework used to collect carrier information. |
StoreKit.framework | The framework used to collect SKAdNetwork information. |
AppTrackingTransparency.framework | The framework used to collect app tracking permission status information. |
AdServices.framework | The framework used to collect Apple Ads' attribution information for iOS 14.3 and later. |
WebKit.framework | Used to collect events using integration with Web SDK. |
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. Navigate to [File]>[Add Packages...] in Xcode.
2. Enter the following address into the search bar and click Add Package.
3. Click Add Package again.
4. The Airbridge iOS SDK will be added to Package Dependencies.
Attention
Before installing the iOS SDK, navigate to [YOUR_PROJECT]>[Build Settings] in your Xcode and make sure to set the User Script Sandboxing to "No." For more details, refer to the CocoaPods document.
1. Install CocoaPods with brew install cocoapods
.
2. Create a Podfile with pod init
.
3. Add the SDK as a dependency with the code below in the Podfile.
target '[Project Name]' do
...
# choose YOUR_VERSION from https://help.airbridge.io/developers/release-note-ios-sdk
# example: pod 'airbridge-ios-sdk-restricted', '4.X.X'
pod 'airbridge-ios-sdk-restricted', 'YOUR_VERSION'
...
end
4. The installation will start when you enter pod install --repo-update
.
5. Run YOUR_PROJECT.xcworkspace
to verify that the Airbridge iOS SDK is successfully installed.
Attention
You cannot install the Airbridge iOS SDK with Tuist's External Dependencies. Make sure to install the iOS SDK using the method below.
1. Run the tuist edit
command.
2. Add remote to project.packages
. Add the package
to project.targets [...].target.dependencies
. Refer to the code below.
import ProjectDescription
let project = Project(
packages: [
.remote(
url: "https://github.com/ab180/airbridge-ios-sdk-restricted-deployment",
// choose YOUR_VERSION from https://help.airbridge.io/developers/release-note-ios-sdk
// example: requirement: .exact(from: "4.X.X")
requirement: .exact(from: "YOUR_VERSION")
),
...
],
targets: [
.target(
dependencies: [
.package(product: "Airbridge", type: .runtime),
...
]
),
...
],
...
)
3. Run the tuist generate
command.
4. Airbridge is added to the Package Dependencies in Xcode.
1. Download the Airbridge iOS SDK from the link below.
2. Add Airbridge.xcframework to your project. Navigate to [Project File]>[General]>[Frameworks, Libraries, and Embedded Content] in Xcode and click +.
3. Click Add Files... under [Add Other...] and select Airbridge.xcframework.
4. Set the Embed of Airbridge.xcframework to "Do not Embed."
5. Add the framework corresponding to the dependency of SDK to the project. Navigate to [Project File]>[General]>[Frameworks, Libraries, and Embedded Content] in Xcode and click +.
6. Add all the frameworks below. Set the Embed of the added frameworks to "Do not Embed." Then, navigate to [Project File]>[Build Phase]>[Link Binary With Libraries] in the Xcode and set the Status to "Optional."
Framework | Description |
---|---|
CoreTelephony.framework | The framework used to collect carrier information. |
StoreKit.framework | The framework used to collect SKAdNetwork information. |
AdServices.framework | The framework used to collect Apple Ads' attribution information for iOS 14.3 and later. |
WebKit.framework | Used to collect events using integration with Web SDK. |
SDK initialization methods vary depending on the system architecture. For SceneDelegate Lifecycle or AppDelegate Lifecycle, refer to the method for AppDelegate. For SwiftUI Lifecycle, refer to the method for SwiftUI.
The YOUR_APP_NAME and YOUR_APP_SDK_TOKEN can be found on the [Settings]>[Tokens] page in the Airbridge dashboard.
Call the Airbridge.initializeSDK
function at the very top of AppDelegate's application(_:didFinishLaunchingWithOptions:)
function.
import UIKit
import Airbridge
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
return true
}
}
Attention
Make sure that the
Airbridge.initalizeSDK
function is called within theapplication(_:didFinishLaunchingWithOptions:)
of theAppDelegate
for proper functionality.
Call the Airbridge.initializeSDK
function at the very top of AppDelegate's application(_:didFinishLaunchingWithOptions:)
function.
#import "AppDelegate.h"
#import <Airbridge/Airbridge.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
return YES;
}
@end
Attention
Make sure that the
Airbridge.initalizeSDK
function is called within theapplication(_:didFinishLaunchingWithOptions:)
of theAppDelegate
for proper functionality.
Call the Airbridge.initializeSDK
function at the top of init
.
import SwiftUI
import Airbridge
@main
struct ExampleApp: App {
init() {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Attention
Make sure that the
Airbridge.initalizeSDK
function is called within theinit
of theApp
for proper functionality.
Attention
The SwiftUI Lifecycle method does not provide a Referrer URL, so the Organic Referrer Attribution cannot be used. Even with the use of UIApplicationDelegateAdaptor, the Organic Referrer Attribution cannot be used in the SwiftUI Lifecycle method.
Note
The functions necessary to ensure compliance with privacy policies should be reviewed with legal counsel.
The IDFA can only be collected if users consent to data tracking via the App Tracking Transparency (ATT) prompt.
Event collection should be delayed until the user allows tracking. If the install event is collected before the user allows tracking through the ATT prompt, the install event data will lack an identifier, making performance measurement difficult. We recommend setting a sufficient delay time for event collection to collect identifiers.
1. Prepare the text you will use in the ATT prompt.
2. Enter the prepared text in the NSUserTrackingUsageDescription
key of the Info.plist
file.
Navigate to [YOUR_PROJECT]>[Info]>[Custom iOS Target Properties] in Xcode.
Hover your mouse over the key items, click + that appears, and enter Privacy - Tracking Usage Description
.
Enter the text for the ATT prompt as value.
1. Run the tuist edit
command.
2. Enter NSUserTrackingUsageDescription
as key to .extendingDefault
in project.targets[...].infoPlist
.
3. Enter the text for the ATT prompt as value.
import ProjectDescription
let project = Project(
targets: [
.target(
infoPlist: .extendingDefault(
with: [
"NSUserTrackingUsageDescription": "YOUR_DESCRIPTION",
...
]
),
...
),
...
]
...
)
3. Set the point of time for displaying the ATT prompt on the app.
The ATTrackingManager.requestTrackingAuthorization
function should be called at the desired time you want to display the ATT prompt.
import AppTrackingTransparency
...
ATTrackingManager.requestTrackingAuthorization { _ in }
#import <AppTrackingTransparency/AppTrackingTransparency.h>
...
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {}];
Attention
The
ATTrackingManager.requestTrackingAuthorization
function does not provide the ATT prompt if the app that called it is not in an active state.
The ATT prompt can be displayed as soon as the app is launched.
import Airbridge
import AppTrackingTransparency
...
var observer: Any?
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
...
observer = NotificationCenter.default.addObserver(
forName: UIApplication.didBecomeActiveNotification,
object: nil,
queue: nil
) { [weak self] _ in
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { _ in }
}
if let observer = self?.observer {
NotificationCenter.default.removeObserver(observer)
}
}
#import <Airbridge/Airbridge.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
...
id observer;
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setAutoDetermineTrackingAuthorizationEnabled:NO];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
...
__weak typeof(self) weakSelf = self;
observer = [NSNotificationCenter.defaultCenter addObserverForName:UIApplicationDidBecomeActiveNotification
object:nil
queue:nil
usingBlock:^(NSNotification * _Nonnull notification) {
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {}];
}
if (weakSelf != nil && weakSelf->observer != nil) {
[NSNotificationCenter.defaultCenter removeObserver:observer];
}
}];
import SwiftUI
import Airbridge
import AppTrackingTransparency
@main
struct ExampleApp: App {
var observer: Any?
init() {
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
observer = NotificationCenter.default.addObserver(
forName: UIApplication.didBecomeActiveNotification,
object: nil,
queue: nil
) { [weak self] _ in
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { _ in }
}
if let observer = self?.observer {
NotificationCenter.default.removeObserver(observer)
}
}
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
4. If the install event is not collected, the Airbridge iOS 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 sufficient delayThe default value is 300 seconds, and it can be set up to 3600 seconds (1 hour). for collecting install events. The default setting for the autoDetermineTrackingAuthorizationTimeout
is 30 seconds. It can be set up to 3600 seconds (1 hour).
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME",
token: "YOUR_APP_SDK_TOKEN")
.setAutoDetermineTrackingAuthorizationTimeout(second: 30)
.build()
Airbridge.initializeSDK(option: option)
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setAutoDetermineTrackingAuthorizationTimeoutWithSecond:30];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
Attention
Set a sufficient delay time to collect the app install event. If the SDK collects install events before users can allow tracking on the ATT prompt, the IDFA will not be collected along with the install events.
Attention
Optional settings. Configure only if necessary.
The opt-in policy requires user consent before using user data.
After setting the setAutoStartTrackingEnabled
function to false
, call the startTracking
function at the point of time when you can collect events. The SDK will start collecting events when the startTracking
function is called.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.setAutoStartTrackingEnabled(false)
.build()
Airbridge.initializeSDK(option: option)
...
Airbridge.startTracking()
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setAutoStartTrackingEnabled:NO];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
...
[Airbridge startTracking];
Attention
Optional settings. Configure only if necessary.
The opt-out policy allows the use of user information until the user explicitly declines.
After setting the setAutoStartTrackingEnabled
function 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 Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.setAutoStartTrackingEnabled(true)
.build()
Airbridge.initializeSDK(option: option)
...
Airbridge.stopTracking()
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setAutoStartTrackingEnabled:YES];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
...
[Airbridge stopTracking];
Attention
Optional settings. Configure only if necessary.
With the SDK Signature, you can prevent SDK spoofing and use verified events to measure ad performance.
The SDK Signature credentials, which are the Secret ID and the Secret, are required for the SDK Signature setup. They can be found on the [Management]>[Fraud Validation Rules]>[SDK Signature] page in the Airbridge dashboard. For more details on how to find the SDK Signature credentials, refer to this Airbridge guide.
Once you have the credentials, call the setSDKSignature
function above the SDK initialization code.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.setSDKSignature(
id: "YOUR_SDK_SIGNATURE_SECRET_ID",
secret: "YOUR_SDK_SIGNATURE_SECRET"
)
.build()
Airbridge.initializeSDK(option: option)
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setSDKSignatureWithId:@"YOUR_SDK_SIGNATURE_SECRET_ID"
secret:@"YOUR_SDK_SIGNATURE_SECRET"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
Deep linking allows you to redirect users from ads to specific locations within your app. The data collected from the tracking link enables you to monitor the performance of the deep link in Airbridge.
When a user clicks on the Airbridge tracking link, the scheme deep link embedded in the tracking link is converted into an Airbridge Deep Link, which can be either an HTTP deep link or a scheme deep link. This Airbridge Deep Link redirects the user to the desired app location. Then, the Airbridge SDK converts the Airbridge Deep Link back to the original scheme deep link embedded in the tracking link and passes it to the app.
Example scheme deep link embedded in the tracking link: YOUR_SCHEME://product/12345
Examples of Airbridge Deep Links
HTTP deep link format 1: https://YOUR_APP_NAME.airbridge.io/~~~
HTTP deep link format 2: https://YOUR_APP_NAME.abr.ge/~~~
Scheme deep link format: YOUR_SCHEME://product/12345?airbridge_referrer=~~~
When the app is installed on the device and the tracking link is clicked, the app opens through the Airbridge Deep Link. The Airbridge SDK converts the Airbridge Deep Link into the scheme deep embedded in the tracking link and passes it to the app.
When the app is not installed on the device and the tracking link is clicked, the Airbridge SDK saves the Airbridge Deep Link is saved. After the user is redirected to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge Deep Link into the scheme deep embedded in the tracking link and passes it to the app.
For the deep linking setup, the following information is required.
Deep link information submitted in the Airbridge dashboard
In-app location address for user redirection
First, 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.
Attention
To ensure proper user redirection, the iOS URI scheme and iOS App ID must be registered differently for the production app and the development app.
Follow the steps below to enter the above information into the Airbridge dashboard.
1. Navigate to [Tracking Link]>[Deep Links] in the Airbridge dashboard.
2. Enter the iOS URI scheme in the iOS URI Scheme field. Include ://
. For example, if the iOS URI scheme is demo
, 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
.
After entering the deep link information into the Airbridge dashboard, an additional app setup is required. Check the required setup process below, which varies by the app's system method.
The app setup is required to enable the following.
App launch with Airbridge Deep Links
Airbridge Deep Link event collection
User redirection with Airbridge Deep Links
Perform the following setup to enable app launch with Airbridge Deep Links after the user clicks on a tracking link.
1. Navigate to [YOUR_PROJECT]>[Info]>[URL Types] in Xcode.
2. Click + and enter the iOS URI scheme that has been submitted to the Airbridge dashboard into the URL Schemes field.
Attention
Enter the iOS URL scheme without
://
.
3. Navigate to [YOUR_PROJECT]>[Signing & Capabilities] in Xcode.
4. Click + Capabilities 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 users of the app.
For more information, refer to this troubleshooting guide.
Attention
Deep link events cannot be automatically collected on iOS. You must pass the deep link events to the Airbridge SDK using the
Airbridge.trackDeeplink
function.
To pass the deep link events to the Airbridge SDK, the Airbridge.trackDeeplink
function should be called at the top of the OS callback triggered when the app is opened through a deep link.
import Airbridge
...
Airbridge.trackDeeplink(url: url)
Airbridge.trackDeeplink(userActivity: userActivity)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackDeeplinkWithUrl:url];
[Airbridge trackDeeplinkWithUserActivity:userActivity];
Detailed settings differ depending on the status of the app.
1. Call the Airbridge.trackDeeplink
function within the function triggered when the app is opened through a scheme deep link or universal link.
import Airbridge
...
// when terminated app is opened with scheme deeplink or universal links
func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
// when app is opened with scheme deeplink
if let url = connectionOptions.urlContexts.first?.url {
// track deeplink
Airbridge.trackDeeplink(url: url)
}
// when app is opened with universal links
else if let userActivity = connectionOptions.userActivities.first {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
}
}
#import <Airbridge/Airbridge.h>
...
// when terminated app is opened with scheme deeplink or universal links
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
// when app is opened with scheme deeplink
NSURL* url = connectionOptions.URLContexts.allObjects.firstObject.URL;
NSUserActivity* userActivity = connectionOptions.userActivities.allObjects.firstObject;
if (url != nil) {
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
}
else if (userActivity != nil) {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
}
}
2. Call the Airbridge.trackDeeplink
function within the function triggered when the backgrounded app is launched through a scheme deep link.
import Airbridge
...
// when backgrounded app is opened with scheme deeplink
func scene(
_ scene: UIScene,
openURLContexts URLContexts: Set<UIOpenURLContext>
) {
guard let url = URLContexts.first?.url else { return }
// track deeplink
Airbridge.trackDeeplink(url: url)
}
#import <Airbridge/Airbridge.h>
...
// when backgrounded app is opened with scheme deeplink
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
NSURL* url = URLContexts.allObjects.firstObject.URL;
if (url == nil) { return; }
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
}
3. Call the Airbridge.trackDeeplink
function within the function triggered when the backgrounded app is launched through a universal link.
import Airbridge
...
// when backgrounded app is opened with universal links
func scene(
_ scene: UIScene,
continue userActivity: NSUserActivity
) {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
}
// when backgrounded app is opened with universal links
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
}
To redirect users to the intended destination, the Airbridge Deep Link must be converted into a scheme deep link using the Airbridge.handleDeeplink
function.
import Airbridge
...
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
...
// handle deeplink
var isHandled = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
#import <Airbridge/Airbridge.h>
...
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
...
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
The Airbridge.handleDeeplink
function returns true
and passes the scheme deep link to the callback when an Airbridge Deep Link is input. If a deep link other than an Airbridge Deep Link is input, it returns false
and passes nothing to a callback. Using this function, the Airbridge Deep Links can be handled separately from other deep links.
Depending on the system method and app status, call the Airbridge.handleDeeplink
function under the OS callback Airbridge.trackDeeplink
function triggered when the app is launched through a deep link. If necessary, the existing logic should be processed together.
1. Implement a function in SceneDelegate to process the app when launched by Airbridge Deep Links.
import Foundation
...
// when app is opened with airbridge deeplink
func handleAirbridgeDeeplink(url: URL) {
// show proper content using url (YOUR_SCHEME://...)
}
import Foundation
...
// when app is opened with airbridge deeplink
- (void)handleAirbridgeDeeplink:(NSURL *)url {
// show proper content using url (YOUR_SCHEME://...)
}
2. Call the Airbridge.handleDeeplink
function within the function triggered when the app is launched through a scheme deep link or universal link. Send users to the intended destination using the converted scheme deep link.
import Airbridge
...
// when terminated app is opened with scheme deeplink or universal links
func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
// when app is opened with scheme deeplink
if let url = connectionOptions.urlContexts.first?.url {
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
}
// when app is opened with universal links
else if let userActivity = connectionOptions.userActivities.first {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
}
}
#import <Airbridge/Airbridge.h>
...
// when terminated app is opened with scheme deeplink or universal links
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
// when app is opened with scheme deeplink
NSURL* url = connectionOptions.URLContexts.allObjects.firstObject.URL;
NSUserActivity* userActivity = connectionOptions.userActivities.allObjects.firstObject;
if (url != nil) {
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
else if (userActivity != nil) {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
}
3. Call the Airbridge.trackDeeplink
function within the function triggered when the backgrounded app is launched through a scheme deep link. Send users to the intended destination using the converted scheme deep link.
import Airbridge
...
// when backgrounded app is opened with scheme deeplink
func scene(
_ scene: UIScene,
openURLContexts URLContexts: Set<UIOpenURLContext>
) {
guard let url = URLContexts.first?.url else { return }
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
}
#import <Airbridge/Airbridge.h>
...
// when backgrounded app is opened with scheme deeplink
- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
NSURL* url = URLContexts.allObjects.firstObject.URL;
if (url == nil) { return; }
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
4. Call the Airbridge.trackDeeplink
function within the function triggered when the backgrounded app is launched through a universal link. Send users to the intended destination using the converted scheme deep link.
import Airbridge
...
// when backgrounded app is opened with universal links
func scene(
_ scene: UIScene,
continue userActivity: NSUserActivity
) {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
}
// when backgrounded app is opened with universal links
- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
}
The app setup is required to enable the following.
App launch with Airbridge Deep Links
Airbridge Deep Link event collection
User redirection with Airbridge Deep Links
The app should be launched with the Airbridge Deep Link when the user clicks the tracking link.
1. Navigate to [YOUR_PROJECT]>[Info]>[URL Types] in Xcode.
2. Click + and enter the iOS URI scheme that has been entered into the Airbridge dashboard into the URL Schemes field.
Attention
Enter the iOS URL scheme without
://
.
3. Navigate to [YOUR_PROJECT]>[Signing & Capabilities] in Xcode.
4. Click + Capabilities 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 users of the app.
For more information, refer to this troubleshooting guide.
Attention
Deep link events cannot be automatically collected on iOS. You must pass the deep link events to the Airbridge SDK using the
Airbridge.trackDeeplink
function.
The deep link events should be passed to the Airbridge SDK for collection. Call the Airbridge.trackDeeplink
function at the top of the OS callback when the app is launched with a deep link.
import Airbridge
...
Airbridge.trackDeeplink(url: url)
Airbridge.trackDeeplink(userActivity: userActivity)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackDeeplinkWithUrl:url];
[Airbridge trackDeeplinkWithUserActivity:userActivity];
Call the Airbridge.trackDeeplink
function in the function that is called when the app is launched with a scheme deep link or a universal link. Use the Airbridge.trackDeeplink
function to deliver the deep link to the Airbridge SDK.
import SwiftUI
import Airbridge
@main
struct ActualApp: App {
var body: some Scene {
WindowGroup {
ContentView()
// when app is opened with scheme deeplink or universal links
.onOpenURL { url in
// track deeplink
Airbridge.trackDeeplink(url: url)
}
}
}
}
To redirect users to the intended destination, the Airbridge Deep Link must be converted into a scheme deep link using the Airbridge.handleDeeplink
function.
import Airbridge
...
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
...
// handle deeplink
var isHandled = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
#import <Airbridge/Airbridge.h>
...
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
...
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
The Airbridge.handleDeeplink
function returns true
and the scheme deep link as a callback if an Airbridge Deep Link is input. If anything other than an Airbridge Deep Link is input, it returns false
and doesn’t provide a callback. Using this function, the Airbridge Deep Links can be handled separately from other deep links.
Call the Airbridge.handleDeeplink
function under the OS callback Airbridge.trackDeeplink
function, which is called by the app when launched with a deep link. If necessary, the existing logic should be processed together.
Call the Airbridge.handleDeeplink
function in the function that is called when the app is launched with a scheme deep link or a universal link. Send users to the intended destination using the converted scheme deep link.
import SwiftUI
import Airbridge
@main
struct ActualApp: App {
var body: some Scene {
WindowGroup {
ContentView()
// when app is opened with scheme deeplink or universal links
.onOpenURL { url in
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
}
}
}
}
The app setup is required to enable the following.
App launch with Airbridge Deep Links
Airbridge Deep Link event collection
User redirection with Airbridge Deep Links
The app should be launched with the Airbridge Deep Link when the user clicks the tracking link.
1. Navigate to [YOUR_PROJECT]>[Info]>[URL Types] in Xcode.
2. Click + and enter the iOS URI scheme that has been entered into the Airbridge dashboard into the URL Schemes field.
Attention
Enter the iOS URL scheme without
://
.
3. Navigate to [YOUR_PROJECT]>[Signing & Capabilities] in Xcode.
4. Click + Capabilities 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 users of the app.
For more information, refer to this troubleshooting guide.
Attention
Deep link events cannot be automatically collected on iOS. You must pass the deep link events to the Airbridge SDK using the
Airbridge.trackDeeplink
function.
The deep link events should be passed to the Airbridge SDK for collection. Call the Airbridge.trackDeeplink
function at the top of the OS callback when the app is launched with a deep link.
import Airbridge
...
Airbridge.trackDeeplink(url: url)
Airbridge.trackDeeplink(userActivity: userActivity)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackDeeplinkWithUrl:url];
[Airbridge trackDeeplinkWithUserActivity:userActivity];
The detailed setup method varies depending on the Airbridge Deep Link type.
1. When the app is launched with a scheme deep link, call the Airbridge.trackDeeplink
function in the function that is called when the app is lauched.
import Airbridge
...
// when app is opened with scheme deeplink
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
Airbridge.trackDeeplink(url: url)
return true
}
#import <Airbridge/Airbridge.h>
...
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
return YES;
}
2. When the app is launched with a Universal Link, call the Airbridge.trackDeeplink
function in the function that is called when the app is lauched.
// when app is opened with universal links
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
return true
}
#import <Airbridge/Airbridge.h>
...
// when app is opened with universal links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
return YES;
}
To redirect users to the intended destination, the Airbridge Deep Link must be converted into a scheme deep link using the Airbridge.handleDeeplink
function.
import Airbridge
...
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
...
// handle deeplink
var isHandled = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
#import <Airbridge/Airbridge.h>
...
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
...
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
The Airbridge.handleDeeplink
function returns true
and the scheme deep link as a callback if an Airbridge Deep Link is input. If anything other than an Airbridge Deep Link is input, it returns false
and doesn’t provide a callback. Using this function, the Airbridge Deep Links can be handled separately from other deep links.
Call the Airbridge.handleDeeplink
function under the OS callback Airbridge.trackDeeplink
function, which is called by the app when launched with a deep link. If necessary, the existing logic should be processed together.
1. Implement a function to process apps launched by Airbridge Deep Links in AppDelegate.
import Foundation
...
// when app is opened with airbridge deeplink
func handleAirbridgeDeeplink(url: URL) {
// show proper content using url (YOUR_SCHEME://...)
}
import Foundation
...
// when app is opened with airbridge deeplink
- (void)handleAirbridgeDeeplink:(NSURL *)url {
// show proper content using url (YOUR_SCHEME://...)
}
2. Call the Airbridge.handleDeeplink
function from the function that is called when the app is launched with a scheme deep link. Send users to the intended destination using the converted scheme deep link.
import Airbridge
...
// when app is opened with scheme deeplink
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
// track deeplink
Airbridge.trackDeeplink(url: url)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(url: url) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
return isHandled
}
#import <Airbridge/Airbridge.h>
...
// when app is opened with scheme deeplink
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
// track deeplink
[Airbridge trackDeeplinkWithUrl:url];
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUrl:url onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
return isHandled;
}
3. Call the Airbridge.handleDeeplink
function from the function that is called when the app is launched with a universal link. Send users to the intended destination using the converted scheme deep link.
// when app is opened with universal links
func application(
_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
) -> Bool {
// track deeplink
Airbridge.trackDeeplink(userActivity: userActivity)
// handle deeplink
var isHandled = Airbridge.handleDeeplink(userActivity: userActivity) { url in
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
handleAirbridgeDeeplink(url: url)
}
if isHandled { return }
// when app is opened with other deeplink
// use existing logic as it is
return isHandled
}
#import <Airbridge/Airbridge.h>
...
// when app is opened with universal links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
// track deeplink
[Airbridge trackDeeplinkWithUserActivity:userActivity];
// handle deeplink
BOOL isHandled = [Airbridge handleDeeplinkWithUserActivity:userActivity onSuccess:^(NSURL* url) {
// when app is opened with airbridge deeplink
// show proper content using url (YOUR_SCHEME://...)
[self handleAirbridgeDeeplink:url];
}];
if (isHandled) { return; }
// when app is opened with other deeplink
// use existing logic as it is
return isHandled;
}
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.
Use the Airbridge.handleDeferredDeeplink
function to convert the saved Airbridge Deep Link into a scheme deep link after collection and pass it to the app. The converted scheme deep link should be used to send the user to the intended destination.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.build()
Airbridge.initializeSDK(option: option)
...
let isHandled = Airbridge.handleDeferredDeeplink() { url in
if let url {
// show proper content using url (YOUR_SCHEME://...)
}
}
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
...
BOOL isHandled = [Airbridge handleDeferredDeeplinkOnSuccess:^(NSURL* url) {
if (url != nil) {
// show proper content using url (YOUR_SCHEME://...)
}
}];
The Airbridge.handleDeferredDeeplink
function returns true
if the app is installed and called for the first time, waits for the Airbridge Deep Link collection, and converts it to a scheme deep link to pass it to onSuccess
. You can use this scheme deep link to send users to the intended destination.
If there is no stored Airbridge Deep Link, nil
is passed to onSuccess
. If the SDK is not initialized or if the Airbridge.handleDeferredDeeplink
function has not been called for the first time, false
will be returned.
The scheme deep link passed is generally in the format of YOUR_SCHEME://...
URL. If you use services like Meta Deferred App Links, it may be passed in a different format.
The Airbridge SDK collects user actions from the app as per settings and sends them as in-app events.
SDK setup for hybrid app
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.
Component | Required | Type | Description |
---|---|---|---|
category | Required | String | Event name |
semanticAttributes | Optional | [String: Any] | Semantic attributes of events |
customAttributes | Optional | [String: Any] | Custom attributes of 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.
You can send a custom event by entering the event name set in the event taxonomy.
Refer to the example below.
import Airbridge
...
// 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")
#import <Airbridge/Airbridge.h>
...
// track standard event (provided by sdk)
[Airbridge trackEventWithCategory:AirbridgeCategory.ORDER_COMPLETED];
// track standard event (not provided by sdk)
[Airbridge trackEventWithCategory:@"airbridge.ecommerce.order.canceled"];
// track custom event
[Airbridge trackEventWithCategory:@"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.
In the Airbridge.trackEvent
function, you can enter Action, Label, Value, and Semantic Attributes using the semanticAttributes
parameter and 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 Airbridge
...
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",
]
)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:@"event" 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 data type below.
import Airbridge
...
Airbridge.trackEvent(
category: "event",
semanticAttributes: [
AirbridgeAttribute.VALUE: 10,
],
customAttributes: [
"string": "string",
"number": 1000,
"boolean": true,
"object": ["key": "value"],
"array": ["value"],
]
)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:@"event" semanticAttributes:@{
AirbridgeAttribute.VALUE: @(10),
} customAttributes:@{
@"string": "string",
@"number": @(1000),
@"boolean": @(YES),
@"object": @{@"key": @"value"},
@"array": @[@"value"],
@"key": @"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).
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.setSessionTimeout(second: 300)
.build()
Airbridge.initializeSDK(option: option)
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setSessionTimeoutWithSecond:300];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
Attention
The Airbridge SDK collects Open events and Foreground events that initiate a new session. However, those events are not collected during a session. To collect them while the session is being maintained, additional settings are required.
The Airbridge SDK maintains a queue of collected events and transmits them until they are empty.
When event transmission fails, it is attempted again after waiting for 1, 2, 4, or... seconds, depending on the number of times it failed. If the transmission fails again, the SDK waits for the set event transmission interval and repeats loading events until it is successful.
The default transmission interval is set to 0 seconds. Using the setEventTransmitInterval
function, you can modify it to a maximum of 86,400 seconds (1 day).
Refer to the example below.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_SDK_TOKEN")
.setEventTransmitInterval(second: 0)
.build()
Airbridge.initializeSDK(option: option)
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_SDK_TOKEN"];
[optionBuilder setEventTransmitIntervalWithSecond:0];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
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 the setEventBufferSizeLimit
function. The highest allowable event count is INT_MAX, and the highest maximum event size you can set is 1024 GiB (gibibytes).
Refer to the example below.
import Airbridge
...
let option = AirbridgeOptionBuilder(name: "YOUR_APP_NAME", token: "YOUR_APP_TOKEN")
.setEventBufferCountLimit(Int.max)
.setEventBufferSizeLimit(gibibyte: 1024)
.build()
Airbridge.initializeSDK(option: option)
#import <Airbridge/Airbridge.h>
...
AirbridgeOptionBuilder* optionBuilder = [[AirbridgeOptionBuilder alloc] initWithName:@"YOUR_APP_NAME"
token:@"YOUR_APP_TOKEN"];
[optionBuilder setEventBufferCountLimit:INT_MAX];
[optionBuilder setEventBufferSizeLimitWithGibibyte:1024];
AirbridgeOption* option = [optionBuilder build];
[Airbridge initializeSDKWithOption:option];
When the event deletion option is activated, all in-app events that are not transmitted during the initialization process are deleted. By default, the event deletion option is inactive.
Set the setClearEventBufferOnInitializeEnabled
function to true
to activate the event deletion option.
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 only specified device identifiers. |
| Deletes all device identifiers. |
Refer to the example below.
import Airbridge
...
Airbridge.setDeviceAlias(key: "string", value: "string")
Airbridge.removeDeviceAlias(key: "string")
Airbridge.clearDeviceAlias()
#import <Airbridge/Airbridge.h>
...
[Airbridge setDeviceAliasWithKey:@"string" value:@"string"];
[Airbridge removeDeviceAliasWithKey:@"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
...
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 <Airbridge/Airbridge.h>
...
[Airbridge setUserID:@"string"];
[Airbridge setUserAliasWithKey:@"string" value:@"string"];
[Airbridge setUserEmail:@"string"];
[Airbridge setUserPhone:@"string"];
[Airbridge setUserAttributeWithKey:@"string" value:@"string"];
[Airbridge trackEventWithCategory:AirbridgeCategory.SIGN_UP];
import Airbridge
...
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 <Airbridge/Airbridge.h>
...
[Airbridge setUserID:@"string"];
[Airbridge setUserAliasWithKey:@"string" value:@"string"];
[Airbridge setUserEmail:@"string"];
[Airbridge setUserPhone:@"string"];
[Airbridge setUserAttributeWithKey:@"string" value:@"string"];
[Airbridge trackEventWithCategory:AirbridgeCategory.SIGN_IN];
import Airbridge
...
Airbridge.trackEvent(
category: AirbridgeCategory.SIGN_OUT
)
Airbridge.clearUser()
#import <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.SIGN_OUT];
[Airbridge clearUser];
import Airbridge
...
Airbridge.trackEvent(
category: AirbridgeCategory.HOME_VIEWED
)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.HOME_VIEWED];
import Airbridge
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory: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 Airbridge
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory: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 Airbridge
...
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",
],
],
]
)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory: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",
},
],
}];
import Airbridge
...
Airbridge.trackEvent(
category: AirbridgeCategory.ADD_PAYMENT_INFO,
semanticAttributes: [
AirbridgeAttribute.TYPE: "CreditCard",
]
)
#import <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.ADD_PAYMENT_INFO semanticAttributes:@{
AirbridgeAttribute.TYPE: @"CreditCard",
}];
import Airbridge
...
Airbridge.trackEvent(
category: AirbridgeCategory.ADD_TO_WISHLIST,
semanticAttributes: [
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/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.ADD_TO_WISHLIST semanticAttributes:@{
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
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory: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 Airbridge
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory: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 Airbridge
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.ORDER_COMPLETED semanticAttributes:@{
AirbridgeAttribute.VALUE: @(11),
AirbridgeAttribute.TRANSACTION_ID: @"8065ef16-162b-4a82-b683-e51aefdda7d5",
AirbridgeAttribute.CURRENCY: @"USD",
AirbridgeAttribute.IN_APP_PURCHASED: @(YES),
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
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.ORDER_CANCELED semanticAttributes:@{
AirbridgeAttribute.VALUE: @(11),
AirbridgeAttribute.TRANSACTION_ID: @"8065ef16-162b-4a82-b683-e51aefdda7d5",
AirbridgeAttribute.CURRENCY: @"USD",
AirbridgeAttribute.IN_APP_PURCHASED: @(YES),
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
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory: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 Airbridge
...
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 <Airbridge/Airbridge.h>
...
[Airbridge trackEventWithCategory:AirbridgeCategory.SUBSCRIBE semanticAttributes:@{
AirbridgeAttribute.VALUE: @(15),
AirbridgeAttribute.CURRENCY: @"USD",
AirbridgeAttribute.TRANSACTION_ID: @"cbe718c7-e44e-4707-b5cd-4a6a29f29649",
AirbridgeAttribute.PERIOD: @"P1M",
AirbridgeAttribute.IS_RENEWAL: @(YES),
AirbridgeAttribute.PRODUCTS: @[
@{
AirbridgeAttribute.PRODUCT_ID: @"306a57cb-f653-4220-a208-8405d8e4d506",
AirbridgeAttribute.PRODUCT_NAME: @"MusicStreamingMemebership",
AirbridgeAttribute.PRODUCT_PRICE: @(15),
AirbridgeAttribute.PRODUCT_CURRENCY: @"USD",
},
],
}];
import Airbridge
...
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",
],
],
]
)