SDKバージョン: 5.0.0(リリースノート)*SDK 5.0.0より一部メソッド名が変更したため必ずリリースノートを確認してください。
1. 概要
AppsFlyerのSDKを利用すると、アプリのインストールやアプリ内イベントを計測することができます。弊社は、非常に堅牢、安全、軽量で、簡単に埋め込むことのできるSDKを開発しました(現在までに計測した70億以上のSDKインストールです)。
インストール、アップデート、セッションを計測し、また、アプリインストールに加えてアプリ内イベント(アプリ内購入、ゲームレベルなど)も計測して、ROIやユーザーエンゲージメントレベルを評価できます。
The AppsFlyer Android SDK is compatible with Android OS version 2.3 and above.
AppsFlyerのAndroid SDK V.3.3.xから移行する場合、こちらをクリックしてください。
ヒント
- Chapters 2 and 3 are MANDATORY to implement BASIC SDK integration, i.e. install attribution only
- Tracking in-app events chapter is HIGHLY RECOMMENDED to implement
- The rest of the described features are OPTIONAL to implement, although some of them may be necessary for you, depending on your app's business logic. For example, tracking revenue or getting the conversion data on first launch may be vital for your app's flow
2. クイックスタート
2.1 SDK Download
最新のAppsFlyer Android SDKのjarをダウンロードするには、こちらをクリックしてください。
SDKダウンロードの整合性を確認するには、こちらをクリックしてください。
AppsFlyerのサンプルアプリに関する詳細については、こちらをクリックしてください。
2.2. アプリへのSDKの埋め込み
AppsFlyerのSDKは、GradleのDependency Managementを使用して自動で連携するか、SDK.jarとして手動で連携することができます。
2.3 プロジェクトへのSDKの追加
GradleのDependency Managementを使用すると、最も簡単にSDKをプロジェクトに連携することができます。バージョン情報についてはこちらをご確認ください。
Gradleを使用しない場合、AF-Android-SDK.jarをダウンロードしてプロジェクトのクラスパスに追加します。
AppsFlyerのAndroid SDK Dependencyの追加:
- プロジェクトを開き(または新しいプロジェクトを作成して)、your_app | build.gradleを開きます。
- Add this to Module-level /app/build.gradle before dependencies:
repositories {
mavenCentral()
}
- Add the implementation dependency with the latest version of the AppsFlyer SDK.
- Add this to Module-level /app/build.gradle after repository:
dependencies {
implementation 'com.appsflyer:af-android-sdk:4+@aar'
implementation 'com.android.installreferrer:installreferrer:1.0'
}
重要!
'com.android.installreferrer:installreferrer:1.0'
のdependencyは、GoogleのPlay Install Referrer APIのサポートに必要となります。このAPIの使用によりアトリビューションの精度を高めたり、不正インストールなどから保護したりできます。- APIは、AppsFlyerのAndroid SDKバージョン4.8.6以降よりサポートされています。これよりも古いSDKバージョンから更新する場合、SDKのinitメソッドを更新して、この新しいdependencyの連携を完了します。
- ProGuardを使用中で、Googleの新しいリファラAPIを使用したい場合、次のProGuardルールを設定する必要があります。
-dontwarn com.android.installreferrer
- GradleビルドまたはAARを使用しておらず、Googleの新しいリファラAPIを使用するには、
com.android.installreferrer jar
をファイルとして手動で追加し、次のパーミッションを追加する必要があります。com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE
2.4 必須パーミッションの設定
AndroidManifest.xmlには、次のパーミッションを含める必要があります。
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- Optional : -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
2.5 BroadcastReceiverのAndroidManifest.xmlへの設定
インストールリファラーブロードキャストレシーバーの実装には、次の2つのオプションがあります。
AndroidManifest.xmlにINSTALL_REFERRER
をリッスンするレシーバーがない場合、次のレシーバーをapplicationタグ内に追加します。
<application
...
...
<receiver android:name="com.appsflyer.SingleInstallBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
...
...
</application>
<application
...
...
<receiver android:name="com.appsflyer.MultipleInstallBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
...
...
</application>
ヒント
If you get the error "Unresolved class SingleInstallBroadcastReceiver" after adding the receiver to AndroidManifest.xml, make sure to build the app first.
3. SDKの初期化
Initialization of the SDK is completed in two stages. In the first stage the DevKey is supplied along with an optional conversionDataListener. In the second stage the call to startTracking indicates that all relevant preparations are complete (e.g. call setCustomerUserId) and the SDK can start tracking all events.
SDKを初期化するには、次のコードをApplication onCreate()
関数に追加します。
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerConversionListener;
public class AFApplication extends Application {
private static final String AF_DEV_KEY = "";
@Override
public void onCreate() {
super.onCreate();
AppsFlyerConversionListener conversionDataListener =
new AppsFlyerConversionListener() {
...
};
AppsFlyerLib.getInstance().init(AF_DEV_KEY, conversionDataListener, getApplicationContext());
AppsFlyerLib.getInstance().startTracking(this); }
}
注
代わりに、startTrackingの呼び出しを遅らせ、関連するActivity OnCreate()関数に配置することもできます。
ヒント
dependancy:compile 'com.android.installreferrer:installreferrer:1.0'
、およびメソッド:AppsFlyerLib.getInstance().init(AF_DEV_KEY, getConversionListener(), getApplicationContext());
で渡されるgetApplicationContext()
は、Googleの新しいReferrer APIをAppsFlyerにレポートするための前提条件となります。
Dev Keyは、管理画面の「設定」>「アプリ設定」ページからご確認いただけます。
このAPIによって、AppsFlyerでインストール、セッション、アップデートを検出できます。
4. アプリ内イベントの計測
アプリ内イベントにより、アプリ内のアクションに関するインサイトを得ることができます。ROI(投資収益率)やLTV(顧客生涯価値)を計測するためにも、計測したいアプリ内イベントを予め検討し定義することをお勧めします。
アプリ内イベントの計測はイベント名やパラメータと一緒にtrackEvent
を呼び出すことにより可能です。 詳細はIn-App Events をご確認ください。
注
アプリ内イベント名は45文字以下である必要があります。日本語ではなく英数字でイベント名を定義することをお勧めします。イベント名が45文字を超える場合は管理画面に表示されず、ローデータ、Push API、Pull APIにのみ表示されます。
//context - getApplicationContext()を使用。
//eventNameは、イベント名を定義するストリングです。
//eventValuesは、リッチイベントを構成するイベントパラメーターのマップです。
public static void trackEvent(Context context, String eventName, Map eventValues);
例:レベル達成アプリ内イベント
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.LEVEL,9);
eventValue.put(AFInAppEventParameterName.SCORE,100);
AppsFlyerLib.getInstance().trackEvent(context,AFInAppEventType.LEVEL_ACHIEVED,eventValue);
これは、次のイベント値でイベントタイプ「af_level_achieved」を生成します。
{af_level: 9, af_score: 100}
注
- AppsFlyerでは、アプリ内イベント、またはAndroid SDKバージョン4.8.1を始めとする他のSDK APIて、英語以外の文字をサポートします。
- 通貨記号やカンマは認識されないため、使用しないでください。
使用例:
Map<String,Object> eventValues = new HashMap<>();
eventValues.put(AFInAppEventParameterName.REVENUE, 1200);
eventValues.put(AFInAppEventParameterName.CURRENCY, "JPY");
AppsFlyerLib.getInstance().trackEvent(this, AFInAppEventType.PURCHASE, eventValues);
5. ディープリンクの計測
ヒント
アプリにディープリンクを連携することを強くお勧めします。ディープリンクはリターゲティングキャンペーンの重要な一部です。リターゲティングキャンペーンを実施する場合は、ディープリンクの使用を強くお勧めします。
ディープリンクに使用される場合がある各アクティビティ(必要に応じて主要アクティビティを含む)については、以下の行をonCreate()
に追加します。
AppsFlyerLib.getInstance().sendDeepLinkData(this);
ディープリンクにより起動されるべきアクティビティには、以下の intent filter をマニフェストファイルのアクティビティの定義に追加する必要があります。
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="yourUniquescheme" />
</intent-filter>
設定されるスキームは、トラッキングリンクに含まれるaf_dp
の値と関連します。
ディープリンクデータを受け取るには、AppsFlyer SDKが呼び出すコールバックonAppOpenAttributionを実装する必要があります。これは、アプリを起動させるトリガーとして使用されるOnelink/トラッキングリンクの各パラメータを返します。その後、値を解析し、ロジックを適用することで関連アプリページをトリガーできます。
void onAppOpenAttribution(Map<String,String> attributionData);
詳細については、こちらをクリックするか、本記事の「コンバージョンデータの取得」セクションを参照してください。
6. 収益の計測
af_revenue
(AFInAppEventParameterName.REVENUE
)イベントパラメータを使用し、収益をアプリ内イベントの一部としてカウントします。正負を問わず、あらゆる数値を入力できます。
注
af_revenue
は、AppsFlyerのローデータと管理画面で収益としてカウントされる唯一のイベントパラメータです。詳細については、こちらをクリックしてください。
例:収益アプリ内イベント
Map<String, Object> eventValue = new HashMap<String, Object>();
eventValue.put(AFInAppEventParameterName.REVENUE,200);
eventValue.put(AFInAppEventParameterName.CONTENT_TYPE,"category_a");
eventValue.put(AFInAppEventParameterName.CONTENT_ID,"1234567");
eventValue.put(AFInAppEventParameterName.CURRENCY,"USD");
AppsFlyerLib.getInstance().trackEvent(getApplicationContext() , AFInAppEventType.PURCHASE , eventValue);
これは、次のイベント値でイベントタイプ「af_purchase」を生成します。
{af_content_id: “1234567”, af_content_type: “category_a”, af_revenue: 200, af_currency: “USD”}
上記の購入イベントは$200の収益を含み、収益として管理画面に表示されます。
注
Setting user local currency code for in-app purchases - the currency code should be a 3 character ISO 4217 code. (default is USD).
次のメソッドを呼び出すことで、すべてのイベントの通貨コードを設定することができます:AppsFlyer.setCurrencyCode("GBP");
重要!
Do NOT format the revenue value in any way. It should not contain comma separators, currency sign, or text. A revenue event should be similar to 1234.56, for example.
7. コンバージョンデータの取得
AppsFlyerを使用すると、SDKレベルから直接、各新規インストールのユーザーアトリビューションデータにリアルタイムでアクセスできます。これにより、パーソナライズされたコンテンツを提供したり、アプリ内の特定のアクティビティに誘導したりして、ユーザーのアプリへのエンゲージメントを大きく高めることができます。
Android SDKからAppsFlyerのコンバージョンデータにアクセスするには、ConversionDataListenerを実装します。
public interface AppsFlyerConversionListener {
void onConversionDataSuccess(Map<String,String> conversionData);
void onConversionDataFail(String errorMessage);
}
例:
import android.app.Application;
import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AppsFlyerConversionListener;
import java.util.Map;
import android.util.Log;
public class AFApplication extends Application {
private static final String AF_DEV_KEY = "qrdZGj123456789";
@Override
public void onCreate() {
super.onCreate();
AppsFlyerConversionListener conversionListener = new AppsFlyerConversionListener() {
@Override
public void onConversionDataSuccess(Map<String, String> conversionData) {
for (String attrName : conversionData.keySet()) {
Log.d("LOG_TAG", "attribute: " + attrName + " = " + conversionData.get(attrName));
}
}
@Override
public void onConversionDataFail(String errorMessage) {
Log.d("LOG_TAG", "error getting conversion data: " + errorMessage);
}
@Override
public void onAppOpenAttribution(Map<String, String> conversionData) {
for (String attrName : conversionData.keySet()) {
Log.d("LOG_TAG", "attribute: " + attrName + " = " + conversionData.get(attrName));
}
}
@Override
public void onAttributionFailure(String errorMessage) {
Log.d("LOG_TAG", "error onAttributionFailure : " + errorMessage);
}
};
AppsFlyerLib.getInstance().init(AF_DEV_KEY, conversionListener, getApplicationContext());
AppsFlyerLib.getInstance().startTracking(this);
}
}
8. ユーザー識別子
AppsFlyerデバイスIDの取得
AppsFlyerの一意のデバイスIDは、アプリが新しくインストールされるたびに作成されます。AppsFlyerの一意のIDを取得するには、次のAPIを使用します。
public String getAppsFlyerUID(Context context);
使用例:
String appsFlyerId = AppsFlyerLib.getInstance().getAppsFlyerUID(this);
顧客ユーザーIDの設定
顧客ユーザーIDを設定するには:
public void setCustomerUserId(String id);
使用例:
AppsFlyerLib.getInstance().setCustomerUserId("myId");
注
It is recommended to set your Customer User ID as soon as possible as it is only associated to events reported after its setup. If setCustomerUserId
is called before calling startTracking
, you will have the Customer User ID in the raw export for installs and for events. If it is set after, you will see the value only for events tracked after calling this method.
Customer User ID can also be used to complete integrations with Analytics platforms such as Mixpanel and Swrve.
顧客ユーザーIDの取得
最初の起動後に顧客ユーザーIDの値を再度設定することのないように、以下を使用して値が空かどうかを確認できます。
AppsFlyerProperties.getInstance().getString(AppsFlyerProperties.APP_USER_ID)
顧客ユーザーIDの詳細については、こちらをクリックしてくだい。
ユーザーメールの設定
利用可能な暗号化方法:Sha1、MD5、SHA256、プレーン
例:
public void setUserEmails(String... emails);
使用例:
AppsFlyerLib.getInstance().setUserEmails(AppsFlyerProperties.EmailsCryptType.MD5, "email1@domain.com","email2@domain.com", ….);
注
メールアドレスなどの個人識別情報(PII)は、AppsFlyerによって保持されず、いずれのレポートにも表示されません。PIIの収集は、メディアソースへのポストバックを目的としてのみ行われます。
Googleの広告ID
SDKバージョン4.8.0以降、AppsFlyerはgoogle_advertising_id
を自動的に収集します。Google Advertising IDを収集する要件は、バージョン4.7以前のSDKにのみ関連します。
IMEIとAndroid ID
デフォルトでは、OSバージョンがKitKat(4.4)より新しく、デバイスにGoogle Play Servicesが含まれている場合(SDKのバージョンが4.8.8以前でGoogle Play Servicesが必要な特定のアプリ)、IMEIとAndroid IDはSDKによって収集されません。
これらのIDをAppsFlyerに明示的に送信するには、開発者は以下のAPIを使用できます。コードはstartTracking
の前に追加します。
AppsFlyerLib.getInstance().setImeiData("IMEI_DATA_HERE");
AppsFlyerLib.getInstance().setAndroidIdData("ANDROID_ID_DATA_HERE");
アプリにGoogle Play Servicesが含まれていない場合、IMEIとAndroid IDはSDKによって収集されます。ただし、 Google Play Servicesを使用したアプリの場合、IMEIの収集がGoogle Playのポリシーに違反するため、収集を行わないようにしてください。
開発者は、これらのAPIを使用することで、IMEIとAndroid IDの収集をオプトアウトすることができます。
AppsFlyerLib.getInstance().setCollectIMEI(false);
AppsFlyerLib.getInstance().setCollectAndroidID(false);
警告
適切なアトリビューションには、少なくとも一つのデバイス識別子、GAID、Android IDまたはIMEIを収集する必要があります。
9. オプション機能
アンインストールの計測
このプロセスを完全かつ正確に完了させるには、こちらをお読みください。
Tracking Push Notifications
AppsFlyerでは、プッシュ通知をリターゲティングキャンペーンの一部として計測することが可能です。
この機能を有効にするには、通知をクリックすると起動されるあらゆるアクティビティのonCreateメソッド内で次のメソッドを呼び出します。
AppsFlyerLib.getInstance().sendPushNotificationData(this);
データペイロードには、関連するキー/値文字列と共にオブジェクト:af
が含まれている必要があります。
例:
{
"data":{
"score":"5x1",
"time":"15:10",
"af":{
"c":"test_campaign",
"is_retargeting":"true",
"pid":"push_provider_int"
}
}
}
{
{
"data":{
"score":"5x1",
"time":"15:10",
"click_action":"com.example.someAction",
"af":{
"c":"test_campaign",
"is_retargeting":"true",
"pid":"push_provider_int"
}
}
}
注
プッシュ通知の計測に関する詳細については、こちらをお読みください。
Cross Promotion Tracking
詳細については、こちらから「クロスプロモーションのトラッキング」に関する記事を参照してください。
ユーザー招待の計測
詳細については、こちらから「ユーザー招待のトラッキング」に関する記事を参照してください。
Set Currency Code
AFInAppEventParameterName.CURRENCY
がアプリ内イベントの一部として送信されない場合に使用されます。
USD(米国ドル)がデフォルト値です。使用可能なISO通貨コードは、こちらで確認することができます。
通貨コードを設定するには、以下のAPIを使用します。
public void setCurrencyCode(String currencyCode);
使用例:
AppsFlyerLib.getInstance().setCurrencyCode("GBP");
アプリ内購入検証
AppsFlyerのSDKは、アプリ内購入のサーバー検証を提供します。購入検証トラッキングを設定するには、onActivityResult
関数内でvalidateAndTrackInAppPurchaseメソッドを呼び出します。
この呼び出しにより、「af_purchase
」アプリ内イベントが自動的に生成されます。
public static void validateAndTrackInAppPurchase(Context context,
String publicKey, String signature, String purchaseData,
String price, String currency, HashMap<String, String> additionalParameters);
この呼び出しには、「Success」と「Failure」(検証の失敗など、あらゆる理由によるもの)の2つのコールバックブロックがあります。
AppsFlyerLib.getInstance().registerValidatorListener(this,new
AppsFlyerInAppPurchaseValidatorListener() {
public void onValidateInApp() {
Log.d(TAG, "Purchase validated successfully");
}
public void onValidateInAppFailure(String error) {
Log.d(TAG, "onValidateInAppFailure called: " + error);
}
});
使用例:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1001) {
String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");
if (resultCode == RESULT_OK) {
HashMap<String,String> event = new HashMap<>();
event.put(AFInAppEventParameterName.PRICE,"9");
AppsFlyerLib.getInstance().validateAndTrackInAppPurchase(getApplicationContext(),publicKey, dataSignature, purchaseData, "3.00", "ILS", event);
}
}
}
注
Calling validateAndTrackInAppPurchase
automatically generates an af_purchase in-app event. There is no need to send this event yourself.
ユーザーデータの匿名化
ユーザーのインストール、イベント、セッションのトラッキングを明示的に匿名化するには、SDKの初期化中にこのAPIを使用します。
public void setDeviceTrackingDisabled(boolean isDisabled);
使用例:
AppsFlyerLib.getInstance().setDeviceTrackingDisabled(true);
トラッキングを再開するには、deviceTrackingDisabled
(falseに設定されている)を再度呼び出します。
警告
ユーザーを匿名化することにより、アトリビューション情報に大きな悪影響があります。ユーザーの情報を収集することが法的に禁じられている地域でのみ、このオプションを使用してください。
カスタムのセッション間隔
However, you can use the following API to set your custom value for the minimum required time between sessions:
AppsFlyerLib.setMinTimeBetweenSessions(int seconds);
Note that setting a high value to the custom time between launches may badly impact APIs relying on sessions data, such as deep linking.
ユーティリティ系アプリ向けバックグラウンドセッション
アプリがバックグラウンドで実行されるユーティリティアプリの場合、このAPIをアクティビティのonCreate()で使用することができます。
public void reportTrackSession(Context context);
使用例:
AppsFlyerLib.getInstance().reportTrackSession(context);
Track Out-of-Store Apps
注
Google Playがデフォルトのストアです。Google Playのみでアプリを公開する場合、このセクションはスキップしてください。
Google Play以外からのインストールを計測するには、各APKに固有のチャネルやストア名を使用して、アプリのAndroidManifest.xmlでチャネルまたはストアを設定します。CHANNEL値では大文字と小文字を区別します。
例:
<meta-data android:name="CHANNEL" android:value="Amazon" />
<meta-data android:name="CHANNEL" android:value="Standalone"/>
<meta-data android:name="CHANNEL" android:value="Verizon" />
注
アプリのセットアップ時にAppsFlyerの管理画面でCHANNEL値を設定する必要があります。
</application>タグの前にmeta-dataタグを配置します。
ストア外アプリのインストールを計測する方法の詳細については、こちらを参照してください。
Opt-Out
いくつかの極端なケースでは、法律とプライバシーの遵守のため、すべてのSDKトラッキングを停止する必要が出てくることがあります。この場合は、isStopTracking APIを使用できます。このAPIが呼び出されると、SDKはサーバーとの通信と動作を停止します。
AppsFlyerLib.getInstance().stopTracking(true, context);
There are several different scenarios for user opt-out. We highly recommend following the exact instructions for the scenario, that is relevant for your app.
In any event, the SDK can be reactivated by calling the same API, by passing false.
重要
isStopTracking
がtrue
に設定されている場合は、trackAppLaunch
の呼び出しをしないでください。
stopTracking
がfalse
に設定された後にトラッキングを再開するには、次のSDK APIを使用します。
AppsFlyerLib.getInstance().trackAppLaunch(getApplicationContext(),AF_DEV_KEY);
警告
stopTracking APIは、本ユーザーをすべてのトラッキングで完全に無視する場合にのみ使用してください。本APIの使用は、レポートとアトリビューションに大きな影響がありますのでご注意ください。
customerUserIDのためのSDK初期化の遅延
customerUserIDが設定されるまで、SDKの初期化を遅らせることができます。この機能を使用すると、customerUserIDが指定されるまで、SDKは動作を開始しません。このAPIを使用する場合、customerUserIDが指定され、トラッキングされるまで、すべてのアプリ内イベントと他のSDK API呼び出しが破棄されます。
To indicate that the SDK should delay initialization for the customer user id call
AppsFlyerLib.getInstance().waitForCustomerUserId(true);
immediately before the init() method. The rest of the SDK initialization should remain unchanged.
Once the customerUserID has been provided, call
AppsFlyerLib.getInstance().setCustomerIdAndTrack("customer_id", this);
to provide the SDK with the relevant customer user id and trigger the SDK to begin its normal tracking.
コードは次のようになります。public class AFApplication extends Application {
private static final String AF_DEV_KEY = ;
@Override
public void onCreate() {
super.onCreate();
AppsFlyerConversionListener conversionDataListener =
new AppsFlyerConversionListener() {
...
};
AppsFlyerLib.getInstance().waitForCustomerUserId(true);
AppsFlyerLib.getInstance().init(AF_DEV_KEY,getConversionListener(), getApplicationContext());
AppsFlyerLib.getInstance().startTracking(this);
// Do your magic to get the customerUserID
// ...
// any AppsFlyer SDK code invoked here will be discarded
//Call the following API once the customerUserID is available:
AppsFlyerLib.getInstance().setCustomerIdAndTrack("customer_id",this);
}
}
警告
ビジネスロジックに適している場合に限り、このAPIを使用してください。このAPIを使用すると、数値の乖離が発生する可能性が高くなるだけでなく、アプリに対して不正が行われる可能性も高くなります。
カスタムデータの追加設定
setAdditionalData APIを使用するには、Segment、Adobe、Urban Airshipなど、複数の外部パートナーのプラットフォームとSDKレベルで連携する必要があります。このAPIは、プラットフォームの連携の記事に、 setAdditionalData APIが必要であると記載されている場合にのみ使用してください。
次に、AndroidでsetAdditionalDataを実装するコードの例を示します。
HashMap<String,Object> CustomDataMap = new HashMap<>();
CustomDataMap.put("custom_param_1","value_of_param_1");
AppsFlyerLib.getInstance().setAdditionalData(CustomDataMap);
プリインストール済みアプリのアトリビューション
プリインストール済みアプリのアトリビューションをAndroidで行う場合、さまざまな方法があります。
詳細については、こちらをクリックしてください。
Setting a Tracking Request Listener
If you want to receive a confirmation that the tracking request was successfully received by the AppsFlyer servers, it is possible to implement the AppsFlyerTrackingRequestListener listener.
The onTrackingRequestSuccess()
callback method is invoked for every 200 response
to an attribution request made by the SDK.
The onTrackingRequestFailure(String error)
callback method is invoked for any other response and returns the response as the error string.
Implementation Example
AppsFlyerLib.getInstance().startTracking(this.getApplication(),"devKey", myListener());
private AppsFlyerTrackingRequestListener myListener() {
return new AppsFlyerTrackingRequestListener() {
@Override public void onTrackingRequestSuccess() {
Log.d("Debug", "Got 200 response from server");
} @Override public void onTrackingRequestFailure(String error) {
Log.d("Debug", error);
}
};
}
10. SDK実装テスト
Google Playストアに送信する前または後にSDKをテストするには、こちらをクリックしてください。
Now you can start tracking the media sources you work with.
11. 既知の問題
ProGuardを使用し、当社のAFKeystoreWrapper
クラスに関して警告が発生した場合、以下のコードをProGuardのルールファイルに追加します。
-keep class com.appsflyer.** { *; }
コメント
ログインしてコメントを残してください。