ユニファイド ディープリンク(UDL)
このページは 新しいバージョンへ移行しました
概要:Unified Deep Linking(UDL)により、アプリ起動時に新規および既存ユーザーを特定のアプリ内アクティビティ(例えば、アプリ内の特定のページなど)に誘導することができます。
UDLのプライバシー保護
For new users, the UDL method only returns parameters relevant to deferred deep linking:
deep_link_value
anddeep_link_sub1-10
. If you try to get any other parameters (media_source
,campaign
,af_sub1-5
, etc.), they returnnull
.
フロー

UDLはモバイルユーザーをアプリ内の特定のアクティビティまたはコンテンツに誘導します。
計測フローは次のとおりです。
- ユーザーがOneLinkのリンクをクリックします。
- ユーザーがアプリをインストールしている場合は、AndroidアプリリンクまたはURIスキームでアプリを開きます。
- ユーザーがアプリをインストールしていない場合は、アプリストアにリダイレクトされ、ダウンロード後、アプリを開きます。
- アプリ起動がAppsFlyer SDKをトリガーします。
- AppsFlyer SDKはUDL APIを実行します。
- UDL APIはOneLinkデータをAppsFlyerサーバーから取得します。
- The UDL API calls back the
onDeepLinking()
メソッドDeepLinkingListener
class. - The
onDeepLinking()
method gets aDeepLinkResult
object. - The
DeepLinkResult
object includes:- Status (Found/Not found/Error)
- A
DeepLink
object that carries thedeep_link_value
anddeep_link_sub1-10
OneLinkの主な目的である特定のアプリ内アクティビティにユーザーをルーティングするために開発者が使用するパラメーター。
前提条件
- UDL には、AppsFlyer Android SDK V6.1以降が必要です。
計画
OneLinkを設定する際は、マーケティング担当者はこのパラメーターをリンクを作成するために使用し、ディベロッパーは、受け取った値をもとにアプリの動作をカスタマイズします。アプリ内でのルーティングやリンク先でのデータのパーソナライズなど、アプリ内でパラメータが正しく処理されるように実装するのはディベロッパーの責任です。
OneLinkの計画方法:
- ユーザーがURLをクリックしたときに、どのような動作が発生し、どのような体験をするのかをマーケティング担当者からヒアリングしてください。
- Based on the desired behavior, plan the
deep_link_value
and other parameters that are needed to give the user the desired personal experience.- The
deep_link_value
is set by the marketer in the URL and used by the developer to redirect the user to a specific place inside the app. For example, if you have a fruit store and want to direct users to apples, the value ofdeep_link_value
can beapples
. - The
deep_link_sub1-10
parameters can also be added to the URL to help personalize the user experience. For example, to give a 10% discount, the value ofdeep_link_sub1
can be10
.
- The
実装
UDL APIを選択したパラメーターと値に基づいて実装してください。
- 次を使用してください:
subscribeForDeepLink()
メソッド(からAppsFlyerLib
)登録しDeepLinkListener
インターフェイスリスナー - コールバック関数をオーバーライドしてください
onDeepLinking()
.
onDeepLinking()
引数 a として受け入れますDeepLinkResult
object. - Use
getStatus()
to query whether the deep linking match is found. - For when the status is an error, call
getError()
and run your error flow. - For when the status is found, use
getDeepLink()
to retrieve theDeepLink
object.
TheDeepLink
オブジェクトには、ディープリンク情報とヘルパー関数が含まれており、よく知られているOneLinkキーから値を簡単に取得できます。getDeepLinkValue()
. - Use
getDeepLinkValue()
to retrieve thedeep_link_value
. - Use
getStringValue("deep_link_sub1")
to retrievedeep_link_sub1
. Do the same fordeep_link_sub2-10
parameters, changing the string value as required. - Once
deep_link_value
anddeep_link_sub1-10
are retrieved, pass them to an in-app router and use them to personalize the user experience.
注意
onDeepLinking
は、アプリがバックグラウンドで動作していて、Application LaunchModeが標準でない場合には呼び出されません。これを修正するには、アプリケーションが非標準の LaunchMode を使用している場合、setIntent(intent) メソッドを呼び出して、オーバーライドされたメソッド onNewIntent の中でインテント値を設定します。
import android.content.Intent; ... ... ... @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); }
Code example
appsflyer.subscribeForDeepLink(new DeepLinkListener(){
@Override
public void onDeepLinking(@NonNull DeepLinkResult deepLinkResult) {
DeepLinkResult.Status dlStatus = deepLinkResult.getStatus();
if (dlStatus == DeepLinkResult.Status.FOUND) {
Log.d(LOG_TAG, "Deep link found");
} else if (dlStatus == DeepLinkResult.Status.NOT_FOUND) {
Log.d(LOG_TAG, "Deep link not found");
return;
} else {
// dlStatus == DeepLinkResult.Status.ERROR
DeepLinkResult.Error dlError = deepLinkResult.getError();
Log.d(LOG_TAG, "There was an error getting Deep Link data: " + dlError.toString());
return;
}
DeepLink deepLinkObj = deepLinkResult.getDeepLink();
try {
Log.d(LOG_TAG, "The DeepLink data is: " + deepLinkObj.toString());
} catch (Exception e) {
Log.d(LOG_TAG, "DeepLink data came back null");
return;
}
// An example for using is_deferred
if (deepLinkObj.isDeferred()) {
Log.d(LOG_TAG, "This is a deferred deep link");
} else {
Log.d(LOG_TAG, "This is a direct deep link");
}
// ** Next if statement is optional **
// Our sample app's user-invite carries the referrerID in deep_link_sub2
// See the user-invite section in FruitActivity.java
if (dlData.has("deep_link_sub2")){
referrerId = deepLinkObj.getStringValue("deep_link_sub2");
Log.d(LOG_TAG, "The referrerID is: " + referrerId);
} else {
Log.d(LOG_TAG, "deep_link_sub2/Referrer ID not found");
}
// An example for using a generic getter
String fruitName = "";
try {
fruitName = deepLinkObj.getDeepLinkValue();
Log.d(LOG_TAG, "The DeepLink will route to: " + fruitName);
} catch (Exception e) {
Log.d(LOG_TAG, "Custom param fruit_name was not found in DeepLink data");
return;
}
goToFruit(fruitName, deepLinkObj);
}
});
AppsFlyerLib.getInstance().subscribeForDeepLink(object : DeepLinkListener{
override fun onDeepLinking(deepLinkResult: DeepLinkResult) {
when (deepLinkResult.status) {
DeepLinkResult.Status.FOUND -> {
Log.d(
LOG_TAG,"Deep link found"
)
}
DeepLinkResult.Status.NOT_FOUND -> {
Log.d(
LOG_TAG,"Deep link not found"
)
return
}
else -> {
// dlStatus == DeepLinkResult.Status.ERROR
val dlError = deepLinkResult.error
Log.d(
LOG_TAG,"There was an error getting Deep Link data: $dlError"
)
return
}
}
var deepLinkObj: DeepLink = deepLinkResult.deepLink
try {
Log.d(
LOG_TAG,"The DeepLink data is: $deepLinkObj"
)
} catch (e: Exception) {
Log.d(
LOG_TAG,"DeepLink data came back null"
)
return
}
// An example for using is_deferred
if (deepLinkObj.isDeferred == true) {
Log.d(LOG_TAG, "This is a deferred deep link");
} else {
Log.d(LOG_TAG, "This is a direct deep link");
}
try {
val fruitName = deepLinkObj.deepLinkValue
Log.d(LOG_TAG, "The DeepLink will route to: $fruitName")
} catch (e:Exception) {
Log.d(LOG_TAG, "There's been an error: $e");
return;
}
}
})
⇲ Github リンク:Java
更新済 2か月前