AppsFlyer integration

AppsFlyerとデータ連携が可能です。

セットアップ

以下の手順に従って、それぞれセットアップを行ってください。

AppsFlyer のセットアップ

AppsFlyerのダッシュボード上で設定が必要です。以下の手順に沿ってセットアップを行ってください。

  1. Settings> Linked partners> Search by "KARTE"
  2. Input "api_key" of the project of KARTE in the integration setting
  3. Default Postbacks> Select “Events attributed to any partner or organic”
  4. Enter "api_key" of the project of KARTE in In-App Events Setting
  5. In-App Events PostbackをONにする
  6. Designate events to cooperate with KARTE
618

KARTE のセットアップ

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

AppsFlyerのイベントをKARTEに送信

AppsFlyerで発生したイベントをKARTEに連携するには、AppsFlyer SDKで取得可能な情報をKARTE SDKを使って送信する必要があります。

インストールイベント

​ ​​ ​​ ​
import KarteCore import AppsFlyerLib class 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.Application import com.appsflyer.AppsFlyerConversionListener import com.appsflyer.AppsFlyerLib import io.karte.android.KarteApp import io.karte.android.tracking.Tracker class 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イベントに設定されるパラメータ備考
Install_appsflyer_installこちらを参考に-
In-app eventappsflyer{event_name}こちらを参考に +
AppsFlyer SDK でイベント送信時に設定した Event Value
・{event_name} には AppsFlyer ダッシュボードで設定したKARTEに送信するイベント名が入ります。
・In-app Event の種類に応じて異なる {event_name} が入ります。

パラメータについての補足

AppsFlyer イベントで定義されている一部のパラメータは、 KARTE イベントでは異なる名前で連携されます。(KARTE 上で日付型のパラメータとして利用できるようにするため)

AppsFlyer イベントでのパラメータ名Parameter name in KARTE event
click_tsclick_date
install_unix_tsinstall_unix_date
timestamptimestamp_date

🚧

広告IDについて

AppsFlyer連携で、広告ID(IDFA/AAID)はKARTEに連携されません。広告IDをKARTEに連携したい場合には、広告ID(IDFA/AAID)の送信についてをご確認ください。


日本語
English
Translated by AI