Integrating with Braze

Purpose of Feature

As the world’s No.1 MMA (Mobile Marketing Automation) solution, Braze offers a precise targeted campaign by creating User segments, based on Airbridge tracking and collected acquisition information (i.e. User driven from certain Paid Channel and/or campaign via Airbridge) from integration with Airbridge.

Integration Requirements

  • This integration is available for iOS and Android Apps.
  • To integrate Airbridge with Braze, first of all, both Airbridge SDK and Braze SDK must be installed to your App.

How to Integrate

Integrating Airbridge to Braze will be made via SDK-to-SDK. Attribution Data collected by Airbridge SDK will be transmitted to Braze, via Braze SDK.

Android

AirbridgeConfig config = new AirbridgeConfig.Builder(BuildConfig.AIRBRIDGE_APP_NAME, BuildConfig.AIRBRIDGE_APP_TOKEN)
        .setOnAttributionResultReceiveListener(new OnAttributionResultReceiveListener() {
            @Override
            public void onAttributionResultReceived(Map<String, String> result) {
                AttributionData data = new AttributionData(
                    result.get("attributedChannel"),
                    result.get("attributedCampaign"),
                    result.get("attributedAdGroup"),
                    result.get("attributedAdCreative")
                );
              
                Appboy.getInstance(applicationContext).getCurrentUser().setAttributionData(data);

                // NOTE: Data point will be consumed
                Appboy.getInstance(applicationContext).getCurrentUser().setCustomUserAttribute("airbridge_ad_content", result.get("attributedContent"));
                Appboy.getInstance(applicationContext).getCurrentUser().setCustomUserAttribute("airbridge_term", result.get("attributedTerm"));
                Appboy.getInstance(applicationContext).getCurrentUser().setCustomUserAttribute("airbridge_sub_id", result.get("attributedSubPublisher"));
                Appboy.getInstance(applicationContext).getCurrentUser().setCustomUserAttribute("airbridge_sub_id_1", result.get("attributedSubSubPublisher1"));
                Appboy.getInstance(applicationContext).getCurrentUser().setCustomUserAttribute("airbridge_sub_id_2", result.get("attributedSubSubPublisher2"));
                Appboy.getInstance(applicationContext).getCurrentUser().setCustomUserAttribute("airbridge_sub_id_3", result.get("attributedSubSubPublisher3"));
            }
        })
        .build();
Airbridge.init(this, config);
val config = AirbridgeConfig.Builder(BuildConfig.AIRBRIDGE_APP_NAME, BuildConfig.AIRBRIDGE_APP_TOKEN)
        .setOnAttributionResultReceiveListener(object : OnAttributionResultReceiveListener {
            override fun onAttributionResultReceived(result: Map<String, String>) {
                val data = AttributionData(
                    result["attributedChannel"],
                    result["attributedCampaign"],
                    result["attributedAdGroup"],
                    result["attributedAdCreative"]
                )

                Appboy.getInstance(applicationContext).currentUser?.setAttributionData(data)
                  
                // NOTE: Data point will be consumed
                Appboy.getInstance(applicationContext).currentUser?.setCustomUserAttribute("airbridge_ad_content", result["attributedContent"])
                Appboy.getInstance(applicationContext).currentUser?.setCustomUserAttribute("airbridge_term", result["attributedTerm"])
                Appboy.getInstance(applicationContext).currentUser?.setCustomUserAttribute("airbridge_sub_id", result["attributedSubPublisher"])
                Appboy.getInstance(applicationContext).currentUser?.setCustomUserAttribute("airbridge_sub_id_1", result["attributedSubSubPublisher1"])
                Appboy.getInstance(applicationContext).currentUser?.setCustomUserAttribute("airbridge_sub_id_2", result["attributedSubSubPublisher2"])
                Appboy.getInstance(applicationContext).currentUser?.setCustomUserAttribute("airbridge_sub_id_3", result["attributedSubSubPublisher3"])
            }
        })
        .build()
Airbridge.init(this, config)

iOS

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, 
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        AirBridge.setting()?.attributionCallback = { attribution in
            let data = ABKAttributionData(network: attribution["attributedChannel"],
                                          campaign: attribution["attributedCampaign"],
                                          adGroup: attribution["attributedAdGroup"],
                                          creative: attribution["attributedAdCreative"])
            
            // NOTE: Data point will be consumed
            Appboy.sharedInstance()?.user.attributionData = data
            
            [
                "attributedContent": "airbridge_content",
                "attributedTerm": "airbridge_term",
                "attributedSubPublisher": "airbridge_sub_id",
                "attributedSubSubPublisher1": "airbridge_sub_id_1",
                "attributedSubSubPublisher2": "airbridge_sub_id_2",
                "attributedSubSubPublisher3": "airbridge_sub_id_3",
            ].forEach { (key, brazeKey) in
                guard let value = attribution[key] else {
                    return
                }
                
                Appboy.sharedInstance()?.user.setCustomAttributeWithKey(brazeKey, andStringValue: value)
            }
            
            Appboy.sharedInstance()?.flushDataAndProcessRequestQueue()
        }
      
        AirBridge.getInstance("YOUR_APP_TOKEN", appName: "YOUR_APP_NAME", withLaunchOptions: launchOptions)
      
        return true
    }
}
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    AirBridge.setting.attributionCallback = ^(NSDictionary<NSString*, NSString*>* _Nonnull attribution) {
        ABKAttributionData* data = [[ABKAttributionData alloc] initWithNetwork:attribution[@"attributedChannel"]
                                                                      campaign:attribution[@"attributedCampaign"]
                                                                       adGroup:attribution[@"attributedAdGroup"]
                                                                      creative:attribution[@"attributedAdCreative"]];
        [Appboy.sharedInstance.user setAttributionData:data];

        // NOTE: Data point will be consumed
        NSDictionary* keyMap = @{
            @"attributedContent": @"airbridge_content",
            @"attributedTerm": @"airbridge_term",
            @"attributedSubPublisher": @"airbridge_sub_id",
            @"attributedSubSubPublisher1": @"airbridge_sub_id_1",
            @"attributedSubSubPublisher2": @"airbridge_sub_id_2",
            @"attributedSubSubPublisher3": @"airbridge_sub_id_3",
        };
        
        for (NSString* key in keyMap.allKeys) {
            NSString* brazeKey = keyMap[key];
            NSString* value = attribution[key];
            
            [Appboy.sharedInstance.user setCustomAttributeWithKey:brazeKey andStringValue:value];
        }
        
        [Appboy.sharedInstance flushDataAndProcessRequestQueue];
    };
  
    [AirBridge getInstance:"YOUR_APP_TOKEN" appName:"YOUR_APP_NAME" withLaunchOptions:launchOptions];

    return YES;
}

@end

Integratable Data Types

Airbridge can send seven types of data to Braze, as in the following. These data are used for User Install Attribution and Custom Attribution. You can view it on Dashboard and use it for filtering.
Besides the four basic data types (Source, Campaign, Ad Group, Ad) offered by Braze, Airbridge offers additional three data types such as airbridge_ad_content, airbridge_medium, airbridge_search_keyword as a Custom Attribute. Among these,airbirdge_search_keyword delivers the keyword to the value when it comes from Naver Web search ad .

📘

Braze data points will be used when you send data marked as optional because it is transmitted as Custom User Attribute.

Airbridge

Braze Segment Filter

Type

Desc

Example

attributedChannel

Install Attribution Source

Install Attribution Data

Name of Paid Ad channel

naver.performance_da

attributedCampaign

Install Attribution Campaign

Install Attribution Data

Name of Campaign

springpromotion_campaign

attributedAdGroup

Install Attribution Ad Group

Install Attribution Data

Name of adGroup

female_2030

attributedAdCreative

Install Attribution Ad

Install Attribution Data

Name of adCreative

adcreative_1

attributedContent (Optional)

airbridge_content

Custom User Attribute

Name of ad copy, slogan, and promotion

slim_fit

attributedTerm (Optional)

airbridge_term

Custom User Attribute

Type of medium

jeans

attributedSubPublisher (Optional)

airbridge_sub_id

Custom User Attribute

Ad search keyword

banner

attributedSubSubPublisher1 (Optional)

airbridge_sub_id_1

Custom User Attribute

sub_id_1

attributedSubSubPublisher2 (Optional)

airbridge_sub_id_2

Custom User Attribute

sub_id_2

attributedSubSubPublisher3 (Optional)

airbridge_sub_id_3

Custom User Attribute

sub_id_3