AppsFlyer連携
AppsFlyerとデータ連携が可能です。
セットアップ
以下の手順に従って、それぞれセットアップを行ってください。
AppsFlyer のセットアップ
AppsFlyerのダッシュボード上で設定が必要です。以下の手順に沿ってセットアップを行ってください。
- 設定>連携済みパートナー>「KARTE」で検索
- インテグレーション設定で、KARTEのプロジェクトの「api_key」を入力
- Default Postbacks>オプション送信を「Events attributed to any partner or organic」を選択
- In-App Events Settingで、KARTEのプロジェクトの「api_key」を入力
- In-App Events PostbackをONにする
- KARTEに連携するイベントを指定する

KARTE のセットアップ
- AppsFlyer プラグインの有効化
- In-Appイベントの連携が必要な場合は、プラグイン設定からIn-App Eventをカンマ区切りで指定してください

AppsFlyerのイベントをKARTEに送信
AppsFlyerで発生したイベントをKARTEに連携するには、AppsFlyer SDKで取得可能な情報をKARTE SDKを使って送信する必要があります。
インストールイベント
import KarteCoreimport AppsFlyerLibclass AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. KarteApp.setup() // AppsFlyer SDK の最新の初期化実装に関しては公式ドキュメントも併せてご覧ください // see: https://dev.appsflyer.com/hc/docs/integrate-ios-sdk AppsFlyerLib.shared().appsFlyerDevKey = "<AF_DEV_KEY>" AppsFlyerLib.shared().appleAppID = "<APPLE_APP_ID>" AppsFlyerLib.shared().delegate = self AppsFlyerLib.shared().start() return true }}extension AppDelegate: AppsFlyerTrackerDelegate { func onConversionDataSuccess(_ conversionInfo: [AnyHashable : Any]) { let isFirstLaunch = (conversionInfo["is_first_launch"] as? Bool) ?? false if (isFirstLaunch) { Tracker.track("_appsflyer_install", values: conversionInfo as! [String: JSONConvertible]) } } func onConversionDataFail(_ error: Error) { }}
#import <AppsFlyerLib/AppsFlyerLib.h>@import KarteCore;@interface AppDelegate () <AppsFlyerLibDelegate>@end@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [KRTApp setupWithConfiguration:[KRTConfiguration default]]; // AppsFlyer SDK の最新の初期化実装に関しては公式ドキュメントも併せてご覧ください // see: https://dev.appsflyer.com/hc/docs/integrate-ios-sdk [[AppsFlyerLib shared] setAppsFlyerDevKey:@"<AF_DEV_KEY>"]; [[AppsFlyerLib shared] setAppleAppID:@"<APPLE_APP_ID>"]; [[AppsFlyerLib shared] setDelegate:self]; [[AppsFlyerLib shared] start]; return YES;}#pragma mark - AppsFlyerLibDelegate implementations- (void)onConversionDataSuccess:(NSDictionary *)conversionInfo { BOOL isFirstLaunch = [conversionInfo objectForKey:@"is_first_launch"]; if (isFirstLaunch) { [KRTTracker track:@"_appsflyer_install" values:conversionInfo]; }}- (void)onConversionDataFail:(NSError *)error {}@end
import android.app.Applicationimport com.appsflyer.AppsFlyerConversionListenerimport com.appsflyer.AppsFlyerLibimport io.karte.android.KarteAppimport io.karte.android.tracking.Trackerclass MainApplication: Application() { override fun onCreate() { super.onCreate() KarteApp.setup(this) // AppsFlyer SDK の最新の初期化実装に関しては公式ドキュメントも併せてご覧ください // see: https://dev.appsflyer.com/hc/docs/integrate-android-sdk AppsFlyerLib.getInstance().init("<AF_DEV_KEY>", object: AppsFlyerConversionListener { override fun onConversionDataSuccess(map: MutableMap<String, Any>?) { val isFirstLaunch = map?.get("is_first_launch") as? Boolean ?: false if (isFirstLaunch) { Tracker.track("_appsflyer_install", map) } } override fun onConversionDataFail(p0: String?) { } override fun onAppOpenAttribution(p0: MutableMap<String, String>?) { } override fun onAttributionFailure(p0: String?) { } }, this) AppsFlyerLib.getInstance().start(this) }}
import android.app.Application;import com.appsflyer.AppsFlyerConversionListener;import com.appsflyer.AppsFlyerLib;import java.util.Map;import io.karte.android.KarteApp;import io.karte.android.tracking.Tracker;public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); KarteApp.setup(this); // AppsFlyer SDK の最新の初期化実装に関しては公式ドキュメントも併せてご覧ください // see: https://dev.appsflyer.com/hc/docs/integrate-android-sdk AppsFlyerConversionListener conversionListener = new AppsFlyerConversionListener() { @Override public void onConversionDataSuccess(Map<String, Object> map) { if ("true".equals(map.get("is_first_launch"))) { Tracker.track("_appsflyer_install", map); } } @Override public void onConversionDataFail(String s) { } @Override public void onAppOpenAttribution(Map<String, String> map) { } @Override public void onAttributionFailure(String s) { } }; AppsFlyerLib.getInstance().init("<AF_DEV_KEY>", conversionListener, this); AppsFlyerLib.getInstance().start(this); }}
In-App イベント
AppsFlyerLib.shared().logEvent("EVENT_NAME", withValues: ["visitor_id": KarteApp.visitorId])
[[AppsFlyerLib shared] logEvent:@"EVENT_NAME" withValues:@{@"visitor_id": [KRTApp visitorId]}];
AppsFlyerLib.getInstance().logEvent(context, "EVENT_NAME", mapOf("visitor_id" to KarteApp.visitorId))
Map<String, Object> eventValue = new HashMap<>();eventValue.put("visitor_id", KarteApp.getVisitorId());AppsFlyerLib.getInstance().logEvent(context, "EVENT_NAME", eventValue);
イベント名とパラメータの対応表
KARTEに連携される AppsFlyer イベントと、KARTEで発生するイベント名およびパラメータの対応表を以下に記載します。
パラメータについての補足
AppsFlyer イベントで定義されている一部のパラメータは、 KARTE イベントでは異なる名前で連携されます。(KARTE 上で日付型のパラメータとして利用できるようにするため)
AppsFlyer イベントでのパラメータ名 | KARTEイベントでのパラメータ名 |
---|---|
click_ts | click_date |
install_unix_ts | install_unix_date |
timestamp | timestamp_date |
🚧
広告IDについて
AppsFlyer連携で、広告ID(IDFA/AAID)はKARTEに連携されません。広告IDをKARTEに連携したい場合には、広告ID(IDFA/AAID)の送信についてをご確認ください。
Updated over 1 year ago