# Airbridge Integration

Airbridge is a mobile app marketing platform that provides various tools and analytics features for user acquisition, retention, and personalized marketing. It is particularly widely used by e-commerce companies and large enterprises in Korea.

By integrating Hackle with Airbridge, you can **import mobile app acquisition data as User Properties and use them for A/B Test targeting or detailed analysis**.

{% hint style="info" %}
**Want to integrate Airbridge with Hackle?**

Integrate Airbridge with Hackle and experience deeper analysis and growth.

[👉 Contact us now](https://hackle.io/ko/?inquiry=true\&utm_source=blog)
{% endhint %}

## Airbridge SDK Integration

To integrate with Airbridge, you need to send the identifiers (user ID) and properties collected by the Airbridge SDK to the Hackle SDK.

{% hint style="warning" %}
SDK call order must be guaranteed

You must call the functions below after the Airbridge SDK initialization is complete to properly retrieve Airbridge information. Then send that information to the Hackle SDK.
{% endhint %}

### Retrieving Airbridge Identifiers

You can call the Airbridge SDK to retrieve Airbridge identifiers. In addition to the most basic Airbridge Device ID, you can use various other identifier information. For details, see [Airbridge's official documentation](https://help.airbridge.io/ko/developers/fetching-guide).

```java
//Airbridge Device ID
import co.ab180.airbridge.Airbridge;
import co.ab180.airbridge.AirbridgeCallback;

Airbridge.getDeviceInfo().getUUID(new AirbridgeCallback.SimpleCallback<String>() {
    @Override
    public void onSuccess(String result) {

    }

    @Override
    public void onFailure(@NotNull Throwable throwable) {

    }
});

//GAID (Google Advertising ID)
import co.ab180.airbridge.Airbridge;
import co.ab180.airbridge.AirbridgeCallback;
import co.ab180.airbridge.AdvertisingIdInfo;

Airbridge.getDeviceInfo().getGoogleAdvertisingIdInfo(new AirbridgeCallback.SimpleCallback<AdvertisingIdInfo>() {
    @Override
    public void onSuccess(AdvertisingIdInfo result) {
            result.getId(); // GAID
        result.getLimitAdTrackingEnabled(); // LAT
    }

    @Override
    public void onFailure(@NotNull Throwable throwable) {

    }
});
```

```kotlin
//Airbridge Device ID
import co.ab180.airbridge.Airbridge
import co.ab180.airbridge.AirbridgeCallback

Airbridge.getDeviceInfo().getUUID(object : AirbridgeCallback.SimpleCallback<String>() {
        override fun onSuccess(result: String) {

    }

    override fun onFailure(throwable: Throwable) {

    }
})

//GAID (Google Advertising ID)
import co.ab180.airbridge.Airbridge
import co.ab180.airbridge.AirbridgeCallback
import co.ab180.airbridge.AdvertisingIdInfo

Airbridge.getDeviceInfo().getAdvertisingIdInfo(object : AirbridgeCallback.SimpleCallback<AdvertisingIdInfo>() {
        override fun onSuccess(result: AdvertisingIdInfo) {
            result.getId() // GAID
        result.getLimitAdTrackingEnabled() // LAT
    }

    override fun onFailure(throwable: Throwable) {

    }
})
```

```swift
//Airbridge Device ID
#import <AirBridge/AirBridge.h>

AirBridge.deviceUUID;

//iOS ID for Advertisers (IDFA)
#import <AdSupport/AdSupport.h>

ASIdentifierManager.sharedManager.advertisingIdentifier.UUIDString;

//iOS ID for Advertisers (IFA)
UIDevice.currentDevice.identifierForVendor.UUIDString;
```

```swift
//Airbridge Device ID
import AirBridge

AirBridge.deviceUUID

//iOS ID for Advertisers (IDFA)
import AdSupport

ASIdentifierManager.shared().advertisingIdentifier.uuidString

//iOS ID for Advertisers (IFA)
UIDevice.current.identifierForVendor?.uuidString
```

```javascript
//Airbridge Cookie ID
airbridge.fetchResource(function(res) {
    console.log(res.browser.clientId) // ex : "2bd08152-0fce-4d5e-8449-f4783b49a2c8"
})
```

### Retrieving Airbridge Attribution Information

You can call the Airbridge SDK to retrieve various attribution information such as ad network and campaign, in addition to identifiers. For more accurate details, see Airbridge's official documentation on attribution results. [(Link)](https://help.airbridge.io/ko/developers/android-sdk#attribution-result-%EC%BD%9C%EB%B0%B1-%EC%84%A4%EC%A0%95)

```java
//Get Attribution Result Callback
AirbridgeConfig config = new AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
	.setOnAttributionResultReceiveListener(new OnAttributionResultReceiveListener() {
		@Override
		public void onAttributionResultReceived(@NonNull Map<String, String> result) {
			// Process attribution data
		}
	})
	.build();
Airbridge.init(this, config);
```

```kotlin
//Get Attribution Result Callback
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
	.setOnAttributionResultReceiveListener(object : OnAttributionResultReceiveListener {
		override fun onAttributionResultReceived(result: Map<String, String>) {
			// Process attribution data
		}
	})
	.build()
Airbridge.init(this, config)
```

```swift
//Get Attribution Result Callback
[AirBridge.setting setAttributionCallback:^(NSDictionary<NSString *,NSString *> * _Nonnull attribution) {
    // Process attribution data...

}];
```

```swift
//Get Attribution Result Callback
AirBridge.setting().attributionCallback = { (attribution: [String : String]) in
    // Process attribution data...

}
```

```javascript
//Get Default Attribution Channel
airbridge.fetchResource(function(res) {
    console.log(res.attributionData.trackingData.channel) // ex : "website"
})

//Get Default Attribution Parameters
airbridge.fetchResource(function(res) {
    console.log(res.attributionData.trackingData.params)  // ex : {medium: "posting", campaign: "blog", term: "airbridge", content: "martech-solution"}
})
```

### Sending Identifiers and Properties to the Hackle SDK

In the code that integrates with Hackle, send the identifiers and properties retrieved from Airbridge as custom identifiers and properties as shown below. For details, see the User Identifier & Properties documentation for each SDK language.

#### Sending Identifiers

Send the desired identifier to the Hackle SDK as a custom identifier.

```java
// Custom Identifier
import io.hackle.sdk.common.User

User user = User.builder()
    .identifier("myCustomId", "42")  // Custom ID
    .build();

hackleApp.setUser(user);
```

```objectivec
// Custom Identifier
HackleUserBuilder *builder = [User builder];
[builder identifier:@"myCustomId" :@"42"]; // Custom ID
User *user = [builder build];

[hackleApp setUserWithUser:user];
```

```swift
// Custom Identifier
let user = User.builder()
    .identifier("myCustomId", "42") // Custom ID
    .build()

hackleApp.setUser(user: user)
```

```javascript
// Custom Identifier
const user = {
  userId: "LOGIN_ID", // User ID (Hackle ID can be used)
  deviceId: "CUSTOM_DEVICE_ID", // Device ID (Hackle ID can be used)
  identifiers: {
    myCustomId: "CUSTOM_IDENTIFIER" // Custom ID
  }
};

hackleClient.setUser(user);
```

#### Sending User Properties

Send the desired attribution information to the Hackle SDK as custom User Properties.

```java
// Custom User Properties
PropertyOperations operations = PropertyOperations.builder()
    .set("age", 42)
    .set("grade", "GOLD")
    .setOnce("sign_up_date", "2020-07-03")
    .build();

hackleApp.updateUserProperties(operations);
```

```objectivec
// Custom User Properties
PropertyOperationsBuilder *builder = [PropertyOperations builder];
[builder set:@"age" :@42];
[builder set:@"grade": @"GOLD"];
[builder setOnce:@"sign_up_date" :@"2020-07-03"];
PropertyOperations *operations = [builder build];

[hackleApp updateUserPropertiesWithOperations:operations];
```

```swift
// Custom User Properties
let operations = PropertyOperations.builder()
    .set("age", 42)
    .set("grade", "GOLD")
    .setOnce("sign_up_date", "2020-07-03")
    .build()

hackleApp.updateUserProperties(operations: operations)
```

```javascript
// Custom User Properties

import { PropertyOperationsBuilder } from "@hackler/javascript-sdk"

const operations = new PropertyOperationsBuilder()
    .set("age", 42)
    .set("grade", "GOLD")
    .setOnce("sign_up_date", "2020-07-03")
    .build();

hackleClient.updateUserProperties(operations);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/external-link/airbridge-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
