Braze 연동 (SDK)

Braze는 Global No.1 모바일 마케팅 자동화 (MMA, Mobile Marketing Automation) 솔루션으로 에어브릿지와의 연동 작업으로 특정 채널 및 캠페인으로 유입된 유저들을 에어브릿지를 통해 수집된 Acquisition 정보를 바탕으로 유저 세그먼트를 생성 및 타게팅하여 더욱 정교화된 마케팅 캠페인이 가능합니다.

에어브릿지 ↔ Braze 연동

에어브릿지와 Braze 연동작업은 에어브릿지 SDK에서 수집되어지는 Attribution Data 정보를 넘겨받아 해당 데이터를 Braze SDK로 전달되어지게 됩니다.

최소 SDK 지원 버전

Android SDK iOS SDK React Native SDK Unity SDK

연동

AirbridgeConfig config = new AirbridgeConfig.Builder(BuildConfig.AIRBRIDGE_APP_NAME, BuildConfig.AIRBRIDGE_APP_TOKEN)
        .setOnAttributionResultReceiveListener(new OnAttributionResultReceiveListener() {
            @Override
            public void onAttributionResultReceived(Map<String, String> result) {
                String channel = result.get("attributedChannel");
                String campaign = result.get("attributedCampaign");
                String adGroup = result.get("attributedAdGroup");
                String adCreative = result.get("attributedAdCreative");
                AttributionData data = new AttributionData(
                    channel != null ? channel : "",
                    campaign != null ? campaign : "",
                    adGroup != null ? adGroup : "",
                    adCreative != null ? adCreative : ""
                );
              
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setAttributionData(data);

                // NOTE: 아래 데이터를 전송 시 데이터 포인트를 소모합니다.
                String content = result.get("attributedContent");
                String term = result.get("attributedTerm");
                String subPublisher = result.get("attributedSubPublisher");
                String subPublisher1 = result.get("attributedSubPublisher1");
                String subPublisher2 = result.get("attributedSubPublisher2");
                String subPublisher3 = result.get("attributedSubPublisher3");
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setCustomUserAttribute("airbridge_ad_content", content != null ? content : "");
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setCustomUserAttribute("airbridge_term", term != null ? term : "");
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setCustomUserAttribute("airbridge_sub_id", subPublisher != null ? subPublisher : "");
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setCustomUserAttribute("airbridge_sub_id_1", subPublisher1 != null ? subPublisher1 : "");
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setCustomUserAttribute("airbridge_sub_id_2", subPublisher2 != null ? subPublisher2 : "");
                Appboy.getInstance(getApplicationContext()).getCurrentUser().setCustomUserAttribute("airbridge_sub_id_3", subPublisher3 != null ? subPublisher3 : "");
            }
        })
        .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: 아래 데이터를 전송 시 데이터 포인트를 소모합니다.
                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)
@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: 아래 데이터를 전송 시 데이터 포인트를 소모합니다.
            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: 아래 데이터를 전송 시 데이터 포인트를 소모합니다.
        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
Airbridge.state.setAttributionListener(attribution => {
    ReactAppboy.setAttributionData(
        attribution['attributedChannel'] || null,
        attribution['attributedCampaign'] || null,
        attribution['attributedAdGroup'] || null,
        attribution['attributedAdCreative'] || null,
    )

    // NOTE: 아래 데이터를 전송 시 데이터 포인트를 소모합니다.
    ReactAppboy.setCustomUserAttribute('airbridge_ad_content', attribution['attributedContent'] || null)
    ReactAppboy.setCustomUserAttribute('airbridge_term', attribution['attributedTerm'] || null)
    ReactAppboy.setCustomUserAttribute('airbridge_sub_id', attribution['attributedSubPublisher'] || null)
    ReactAppboy.setCustomUserAttribute('airbridge_sub_id_1', attribution['attributedSubSubPublisher1'] || null)
    ReactAppboy.setCustomUserAttribute('airbridge_sub_id_2', attribution['attributedSubSubPublisher2'] || null)
    ReactAppboy.setCustomUserAttribute('airbridge_sub_id_3', attribution['attributedSubSubPublisher3'] || null)
});
public class AirbridgeManager : MonoBehaviour
{ 
    private void Awake() 
    {
        // Attribution Data를 전달받기 위해 다음과 같이 메시지를 받기 위한 오브젝트명을 등록해 주세요.
        AirbridgeUnity.SetOnAttributionReceived("AirbridgeManager");
    }
  
    // Method will call by Airbridge when attribution result received
    private void OnAttributionResultReceived(string jsonString)
    {
        // 에어브릿지 ↔ Braze 연동
        Dictionary<string, object> attributionData = AirbridgeJson.Deserialize(jsonString) as Dictionary<string, object>;

        AppboyBinding.SetAttributionData(
            TryGetValueOrEmptyString(attributionData, "attributedChannel"),
            TryGetValueOrEmptyString(attributionData, "attributedCampaign"),
            TryGetValueOrEmptyString(attributionData, "attributedAdGroup"),
            TryGetValueOrEmptyString(attributionData, "attributedAdCreative")
        );
        
        // NOTE: 아래 데이터를 전송 시 데이터 포인트를 소모합니다.
        AppboyBinding.SetCustomUserAttribute("airbridge_ad_content", TryGetValueOrEmptyString(attributionData, "attributedContent"));
        AppboyBinding.SetCustomUserAttribute("airbridge_term", TryGetValueOrEmptyString(attributionData, "attributedTerm"));
        AppboyBinding.SetCustomUserAttribute("airbridge_sub_id", TryGetValueOrEmptyString(attributionData, "attributedSubPublisher"));
        AppboyBinding.SetCustomUserAttribute("airbridge_sub_id_1", TryGetValueOrEmptyString(attributionData, "attributedSubPublisher1"));
        AppboyBinding.SetCustomUserAttribute("airbridge_sub_id_2", TryGetValueOrEmptyString(attributionData, "attributedSubPublisher2"));
        AppboyBinding.SetCustomUserAttribute("airbridge_sub_id_3", TryGetValueOrEmptyString(attributionData, "attributedSubPublisher3"));
    }

    private string TryGetValueOrEmptyString(Dictionary<string, object> dict, string key) 
    {
        if (dict.TryGetValue(key, out var value))
        {
            return value as string ?? "";
        }
        return "";
    }
}

연동 데이터 필드

에어브릿지 Attribution Data는 총 10가지의 데이터를 포함하고 있으며 각 데이터 마다 Braze의 유저의 Install AttributionCustom Attribute 정보에 포함되어지게 되고 해당 데이터들을 Braze 대시보드에서 확인하실 수 있습니다.

📘

Optional로 표기된 데이터의 경우, Custom User Attribute로 전송되기 때문에 Braze 데이터 포인트가 차감됩니다.

📘

네이버 검색 광고로 부터 유입된 사용자의 keywordairbridge_term에 들어가게 됩니다.

Airbridge

Braze Segment Filter

Type

Desc

Example

attributedChannel

Install Attribution Source

Install Attribution Data

광고 채널명

naver.performance_da

attributedCampaign

Install Attribution Campaign

Install Attribution Data

광고 캠페인명

springpromotion_campaign

attributedAdGroup

Install Attribution Ad Group

Install Attribution Data

광고 그룹명

female_2030

attributedAdCreative

Install Attribution Ad

Install Attribution Data

광고 소재명

adcreative_1

attributedContent (Optional)

airbridge_content

Custom User Attribute

광고 카피, 슬로건, 프로모션명

slim_fit

attributedTerm (Optional)

airbridge_term

Custom User Attribute

광고 검색 키워드

jeans

attributedSubPublisher (Optional)

airbridge_sub_id

Custom User Attribute

광고 방식

banner

attributedSubSubPublisher1 (Optional)

airbridge_sub_id_1

Custom User Attribute

마케터 혹은 매체에서 설정한 하하위매체 1

sub_id_1

attributedSubSubPublisher2 (Optional)

airbridge_sub_id_2

Custom User Attribute

마케터 혹은 매체에서 설정한 하하위매체2

sub_id_2

attributedSubSubPublisher3 (Optional)

airbridge_sub_id_3

Custom User Attribute

마케터 혹은 매체에서 설정한 하하위매체3

sub_id_3