Skip to main content
GitHub Tag Install the Airbridge iOS SDK and implement the necessary settings following the steps below.

Install SDK

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.
  1. Click Add Package again.
  2. The Airbridge iOS SDK will be added to Package Dependencies.

Install Restricted SDK

NoteInstall 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.
  1. Click Add Package again.
  2. The Airbridge iOS SDK will be added to Package Dependencies.
  3. 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 +.
  4. 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.”

Initialize 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.
AttentionMake sure that the Airbridge.initalizeSDK function is called within the application(_:didFinishLaunchingWithOptions:) of the AppDelegate for proper functionality.

Configure ATT Prompt

NoteThe 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.
  1. Navigate to [YOUR_PROJECT]>[Info]>[Custom iOS Target Properties] in Xcode.
  2. Hover your mouse over the key items, click + that appears, and enter Privacy - Tracking Usage Description.
  3. Enter the text for the ATT prompt as value.
  1. Set the 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.
AttentionThe 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.
  1. 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 setAutoDetermineTrackingAuthorizationTimeout function can be used to set a sufficient delay before event collection. The default setting is 30 seconds and can be set to up to 3600 seconds (1 hour).
AttentionSet a sufficient delay time to collect the app install event. If the SDK collects install events before users can allow tracking on the ATT prompt, the IDFA won’t be collected along with the install events.

Opt-in setup

AttentionOptional 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 time when you can collect events. The SDK will start collecting events when the startTracking function is called.

Opt-out setup

AttentionOptional 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 time when you can no longer collect events. When the stopTracking function is called, the SDK will stop collecting events.

SDK Signature

AttentionOptional 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.

Deep Linking

Deep linking allows you to redirect users from ads to specific locations within your app. The data collected from the tracking link enables you to monitor the performance of the deep link in Airbridge. When a user clicks on the Airbridge tracking link, the scheme deep link embedded in the tracking link is converted into an Airbridge Deep Link, which can be either an HTTP deep link or a scheme deep link. This Airbridge Deep Link redirects the user to the desired app location. Then, the Airbridge SDK converts the Airbridge Deep Link back to the original scheme deep link embedded in the tracking link and passes it to the app.
  • Example scheme deep link embedded in the tracking link: YOUR_SCHEME://product/12345
  • Examples of Airbridge Deep Links
    • HTTP deep link format 1: https://YOUR_APP_NAME.airbridge.io/~~~
    • HTTP deep link format 2: https://YOUR_APP_NAME.abr.ge/~~~
    • Scheme deep link format: YOUR_SCHEME://product/12345?airbridge_referrer=~~~
When the app is installed on the device and the tracking link is clicked, the app opens through the Airbridge Deep Link. The Airbridge SDK converts the Airbridge Deep Link into the scheme deep link embedded in the tracking link and passes it to the app. When the app is not installed on the device and the tracking link is clicked, the Airbridge SDK saves the Airbridge Deep Link. After the user is redirected to the app store or website and the app is installed and launched, the Airbridge SDK converts the saved Airbridge Deep Link into the scheme deep link embedded in the tracking link and passes it to the app.
Simple structure of Airbridge Deeplink

Set up deep linking

For the deep linking setup, the following information is required.
  • Deep link information submitted in the Airbridge dashboard
  • In-app location address for user redirection
First, enter the deep link information into the Airbridge dashboard.
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
  • User redirection with Airbridge Deep Links
For detailed instructions, refer to the information below.

Set up deferred deep linking

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.
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.
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.
AttentionWhen the app is opened via a deep link, Airbridge passes null to onSuccess regardless of whether a deferred deep link exists or not, ensuring that only the deep link is processed.

Set up custom domain

AttentionOptional settings. Configure only if necessary.
  1. Enter the custom domain address into the Airbridge dashboard by referring to this article
  2. When initializing the Airbridge SDK, use the setTrackingLinkCustomDomainsfunction to add the custom domain address. The YOUR_APP_CUSTOM_DOMAIN should be the Fully Qualified Domain Name (FQDN).
AttentionThe custom domain address you add to the SDK should be the same as the custom domain address entered into the Airbridge dashboard.

In-app Events

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

Send in-app events

SDK setup for hybrid appYou 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. 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.
AttentionThe 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.
AttentionSemantic 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.
Refer to the example codes for each data type below.

Additional in-app event settings

AttentionThe default settings will apply if no additional settings are configured. Proceed after reviewing whether additional settings are necessary.
Configure additional settings for sending in-app events if necessary.
The Airbridge SDK includes session information when sending event data.When the app moves to the background or the process is terminated, the background entry time is recorded. When the app returns to the foreground or the process is restarted, the re-entry time is recorded. If the time difference between the last background entry and re-entry exceeds the session timeout, the previous session ends and a new session begins.The default session timeout is 300 seconds (5 minutes). You can set this value to up to 604,800 seconds (7 days) using the setSessionTimeout function.
AttentionThe Airbridge SDK collects Open events and Foreground events that initiate a new session. However, those events are not collected during a session. To collect them while the session is being maintained, additional settings are required.
The default transmission interval is set to 0 seconds. Using the setEventTransmitInterval function, you can modify it to a maximum of 86,400 seconds (1 day).Refer to the example below.
The following table shows the default and maximum values for the number of events and storage size.If you want to limit the number of events the SDK stores, use the setEventBufferCountLimit function, and to limit the storage size of the SDK, use the setEventBufferSizeLimit function.Refer to the example below.
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.
The Airbridge SDK supports functions to include device identifiers in all events for transmission.
#{“width”: “140px”}
Function
#{“width”: “240px”}
Description
Airbridge.setDeviceAliasAdds additional device identifiers. Up to 10 can be entered.
- key: Maximum 128 characters. It must satisfy the regular expression ^[a-zA-Z_][a-zA-Z0-9_]*$.
- value: Maximum 128 characters.
Airbridge.removeDeviceAliasDeletes only specified device identifiers.
Airbridge.clearDeviceAliasDeletes all device identifiers.
Refer to the example below.

Example codes

Airbridge collects in-app events that are classified as Standard Events and Custom Events. Standard Events are events predefined by Airbridge. Refer to the example codes below.
Sign up
Sign in
Sign out
Home screen view
Product list viewed
Search results view
Product detail page view
Payment method registration
Adding to wishlist
Adding to cart
Start payment
Purchase complete
Purchase cancellation
Start trial
Subscription
Unsubscribe
Ad exposure
Ad click
Tutorial completion
Level achievement
Task completion
Evaluation
Sharing
Schedule reservation
Credit use
Custom Events are events defined by Airbridge users to track user actions that are unique to their services. Refer to the example code below.

User Data

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

Set User IDs

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.
FunctionDescription
Airbridge.setUserIDInputs the user ID.
Airbridge.clearUserIDDeletes the user ID.
Airbridge.setUserAliasAdds additional user identifiers. Up to 10 items can be added.
- key: Up to 128 characters. Must follow the regular expression ^[a-zA-Z_][a-zA-Z0-9_]*$.
- value: Up to 1024 characters.
Airbridge.removeUserAliasDeletes only specified identifiers.
Airbridge.clearUserAliasDeletes all additional user identifiers.
Refer to the example below.

Send additional user information

AttentionSensitive user information may be included. Send after a thorough review with a legal advisor.
Refer to the functions below to send additional user information.
FunctionDescription
Airbridge.setUserEmailInputs the user email. It is hashed with SHA256.
Airbridge.clearUserEmailDeletes the user email.
Airbridge.setUserPhoneInputs user’s phone number. The data is hashed using SHA256.
Airbridge.clearUserPhoneDeletes the user’s phone number.
Airbridge.setUserAttributeAdds additional user attributes. Up to 100 items can be added.
- key: Up to 128 characters. Must satisfy the regular expression: ^[a-zA-Z_][a-zA-Z0-9_]*$.
- value: Only supports string, number, and Boolean types. Up to 1024 characters.
Airbridge.removeUserAttributeDeletes only specified attributes from the additional attributes.
Airbridge.clearUserAttributesDeletes all additional user attributes.
Refer to the example below.
When the Airbridge.setHashUserInformationEnabled function is set to false, the user’s email and phone number are sent without hashing. The default setting is true.

Clear user data

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

Include User Information in Install/Open Events

The SDK automatically sends install and open events immediately after initialization. Therefore, if you call user information functions right after initialization, the user information may not be included in the install/open events depending on the event transmission timing. To ensure user information is included in install/open events, control the timing of event transmission through Opt-In setup. Follow these steps:

Additional SDK Settings

Follow the instructions below for additional setup.
AttentionOptional settings. Configure only if necessary.

Using Multiple Instance Apps

AttentionAirbridge iOS SDK v.4.9.0 or later is required.
By default, the SDK is controlled through the global Airbridge object. However, in certain situations, you may need an independent SDK instance. The SDK supports multi-tenant environments where multiple Airbridge projects can be operated simultaneously within a single app. You can create a new instance using AirbridgeInterface.

Instance Creation and Initialization

Each instance operates completely independently from the global Airbridge object and other instances, allowing you to use all SDK features, including initialization, independently.
SKAdNetwork Identifier Restriction NoticeIn a multi-app environment, SKAdNetwork-related identifiers must be allowed in only one instance.If SKAdNetwork is allowed in multiple instances, SKAdNetwork attribution may not function correctly due to duplicate conversion data.For more details, see Restricting Identifier Tracking.

Event Tracking Example

AttentionAirbridge iOS SDK v.4.10.0 or later is required.
To receive deferred deeplinks in a multi-app environment, use the Airbridge.handleDeferredDeeplink(apps:onSuccess:onFailure) function. When using the existing Airbridge.handleDeferredDeeplink(onSuccess:onFailure) function in a multi-app environment, each Airbridge instance may independently receive the deferred deeplink from the tracking link that was clicked, resulting in duplicate deliveries. This causes the onSuccess callback to be invoked multiple times, which can lead to unintended navigation behavior. The Airbridge.handleDeferredDeeplink(apps:onSuccess:onFailure) function delivers via callback only the deferred deeplink from the most recently clicked tracking link, determined across all Airbridge instances passed through apps. The deferred deeplink is delivered only once per app install.
AttentionIn a multi-app environment, always use Airbridge.handleDeferredDeeplink(apps:onSuccess:onFailure) instead of Airbridge.handleDeferredDeeplink(onSuccess:onFailure).
For details on how deferred deeplinks are retrieved, see Handling Deferred Deeplinks.

Calculating SKAdNetwork Conversion Value on the Server

AttentionAirbridge iOS SDK v.4.8.0 or later is required.
By default, the ConversionValue in SKAdNetwork is calculated using the values from the SDK. If you want to measure events collected server-side through SKAN instead of the SDK, set the calculateSKAdNetworkByServerEnabled option to true.
AttentionIf you are currently using conversion values calculated by the SDK via SKAdNetwork, please exercise caution when making changes. Altering the conversion value calculation method may cause inconsistencies between existing and new data.

Restricting Identifier Tracking

You can prevent the SDK from collecting certain identifier data.
AttentionAirbridge iOS SDK v.4.7.0 or later is required.
When initializing the SDK, call the setTrackingBlocklist method to specify which identifiers should be blocked. Events sent after this configuration will not include those identifiers.
Check the restricted data in the identifier restriction list.
AttentionAirbridge iOS SDK v.4.9.0 or later is required.
While the SDK is running, you can use the allowTrackingItem and blockTrackingItem functions to set the data to be restricted. The specified identifier items will be excluded or included. This does not affect events that have already been stored.
Check the restricted data in the identifier restriction list.

Integrate Google’s ICM attribution data

AttentionAirbridge iOS SDK v.4.4.1 or later is required.
Integrated Conversion Measurement (ICM) is Google’s privacy-driven solution for filling in conversion tracking gaps caused by stricter tracking limitations. Google provides the ICM attribution data, which is the non-deterministic attribution data provided by Google’s privacy-preserving conversion modeling. To integrate the ICM attribution data, the Google’s On-Device Conversion Measurement (ODM) SDK must be installed. For detailed information, refer to this article.
AttentionAirbridge iOS SDK v.4.0.0 or later is required.
Tracking links are links that are embedded to ads for data collection. When users click on the ad, the tracking link is used to pass the touchpoint data to Airbridge, allowing for ad attribution. Also, users who click on the ad with a tracking link can be redirected to a specific destination. Use the createTrackingLink function to create tracking links. Refer to the code examples and the parameter details below.
Use the option parameter in the createTrackingLink function to configure tracking link options.
Use the onSuccess callback in the createTrackingLink function to pass the AirbridgeTrackingLink.
Refer to the example codes below.
Depending on how links are opened, it may be challenging to properly use the tracking link within the app. By using the Airbridge.click function or the Airbridge.impression function, you can properly use the tracking link within the app without sending users to an external browser.
AttentionWhen you set up the Airbridge iOS SDK v1.24.0 or later to use tracking links within apps, every time a tracking link is used within the app, Deeplink Pageviews are aggregated as Target Events. The deep link performance may be affected when Deeplink Pageviews occur frequently right after Deeplink Opens.The attribution window for Deeplink Pageviews is set to 3 days by default. If you want to change the attribution window for Deeplink Pageviews, contact your Airbridge CSM. If you don’t have a dedicated CSM, contact the Airbridge Help Center.

Get attribution results

AttentionIt takes some time for the Airbridge SDK to collect attribution results. We do not recommend using attribution results for functionalities requiring real-time processing.
Use the setOnAttributionReceived function to get the attribution data of install events.
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 result is passed to the callback within 1 minute after the install event is passed. If the app is closed before the attribution result is passed, the previous attribution result will be passed to the callback within 1 minute the next time the app is launched. Depending on network conditions and other factors, there may be a delay of up to 5 minutes.
If there is no attribution result, the following dictionary will be sent to the callback.
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.
The Airbridge SDK collects deep link events when the app is opened through a deep link, even if the deep link is not an Airbridge Deep Link. Set the setTrackAirbridgeDeeplinkOnlyEnabled function to true to collect deep link events only if the app is opened through an Airbridge Deep Link and prevent unnecessary event collection.

Collect events using Action extension

Airbridge iOS SDK v.4.0.0 or later is required.
The Airbridge SDK supports event collection using Action extension. You can collect events using the trackEvent function in an Action extension following the steps below.
  1. Add App Group.
  2. Navigate to [YOUR_PROJECT]>[Signing & Capabilities] in Xcode. Click + Capability and add App Groups. Enter a value in the following format in the App Groups field:
  • group.YOUR_DOMAIN.YOUR_DOMAIN.YOUR_PRODUCT.airbridge
  1. Add the SDK initialization code under the viewDidLoad function.
AttentionYou must carefully decide on setAppGroup settings. You need to delete all information related to the existing Airbridge SDK to remove or change the setAppGroup settings. This may cause unexpected results, such as previously collected install events being collected again.

Compliance with Google DMA

To comply with the Digital Markets Act (DMA), the user consent data must be sent to Airbridge. For more information about the DMA and whether it applies to your service, refer to the Airbridge user guide.
AttentionAdvertisers must collect user consent data from all existing and new users in the EEA at least once starting March 6, 2024.
If you are collecting user consent data using a consent management platform that complies with the Transparency and Consent Framework v2.2 protocol, refer to the following method to pass the user consent data to the Airbridge SDK.
For all other cases, refer to the following method.
AttentionUpon completing the SDK setup to use Meta deferred app links, Facebook SDK’s fetchDeferredAppLink function should not be used.
Follow the steps below to use deferred deep linking in Meta ads. The Airbridge SDK collects the Meta deferred app links before it collects the Airbridge deferred deep links. If there are no Meta deferred app links, the Airbridge deferred deep links are collected. Note that Meta does not support Meta deferred app links for SKAdNetwork campaigns.
  1. Refer to the Meta ads document and install the Facebook SDK.
  2. Set the setTrackMetaDeferredAppLinkEnabled function in the Airbridge SDK to true.

Initialize the Airbridge SDK with all functions disabled

AttentionIf the SDK is not enabled immediately after the SDK initialization, the Install, Open, and Deeplink Openbvevents may not be collected.
Upon initialization, all functions of the SDK are enabled by default. By setting the setSDKEnabled function to false, the SDK can be initialized with all functions disabled.
You can also check the activation status of the Airbridge SDK and enable or disable all functions, as in the following example.

Set up uninstall tracking

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

Integrate with third-party solutions

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

SDK logs

The logs provided by the Airbridge SDK are categorized into Debug, Info, Warning, Error, and Fault levels. The Debug level is the least critical log, while the Fault level is the most critical log. By default, the Airbridge SDK provides logs at Warning, Error, and Fault levels. By entering a specific log level as the value for setLogLevel function, the logs from that specified level up to the Fault level will be available.
How to view Airbridge SDK logs onlyEnter Subsystem: co.ab180.airbridge into the filter at the bottom right in Xcode to view only Airbridge SDK logs.