実装テスト
始める前に
このドキュメントのテストを正常に完了するためには、以下が必要です:
Android SDKの実装テスト
テストは、以下で構成されています:
- 広告クリックとコンバージョンのシミュレーション
- インストールのコンバージョンデータを検証。
Simulate a conversion
ユーザーの広告クリックとアプリインストールをシミュレートしてください。
ステップ1:広告クリックのシミュレーション
計測リンク経由で広告クリックをシミュレートしてください。以下のように計測リンクを構成してください。
https://app.appsflyer.com/<app_id>?pid=<media_source>
&advertising_id=<registered_device_gaid>
場所:
app_id
はあなたのAppsFlyerアプリIDです。pid
は、インストールが紐づくメディアソースですadvertising_id
は登録されたデバイスのGAIDです。
The advertising_id
parameter is required to attribute via ID matching. If omitted, attribution will occur probabilistically.
For example, if your app ID is com.my.app
, the attribution link might look like this:
https://app.appsflyer.com/com.my.app?pid=devtest&c=test1
GAIDの場合:
https://app.appsflyer.com/com.my.app?pid=devtest&c=test1&advertising_id=********-****-****-****-************
ヒント
計測リンクを使用したテストは複数回行われることがよくあります。そのため、アトリビューションパラメータの1つを使用して、テストのバージョンを区別することをお勧めします。どのリンクがどのコンバージョンに紐づいているのかを簡単に把握することができます。
In the above example, the value of
c
istest1
. In consecutive tests, increment the value ofc
totest2
,test3
, and so on.
ステップ2:アプリのインストール
デバッグモードを有効にして、登録したテストデバイスにアプリをインストールしてください。
ステップ3:テストの実行
コンバージョンデータの検証に進んでください。
Inspect conversion data
コンバージョンのシミュレーション後は、以下の手順に従ってインストールのコンバージョンデータを検証してください。
ステップ1:インストールUIDの取得
アプリがインストールされたら、次のデバッグログを検索してください: conversions.appsflyer
ステップ2:コンバージョンデータの検証
コンバージョンデータテストAPIへ進み、必要な項目を入力してください。
app-id
:アプリIDdevice_id
: paste the value ofuid
from step 1.devkey
- Application's devkey. Learn here how to get it.
その後、Try it! をクリックしてテストを実行してください。
期待される結果
インストールのコンバージョンデータを含む200レスポンス(読みやすいように省略済):
{
...
"campaign": "test1",
...
"media_source": "devtest",
...
"af_status": "Non-organic"
...
}
注意
インストールが管理画面に表示されるまで最大30分かかる場合があります。
Android SDK実装のトラブルシューティング
Install always attributed to organic
シナリオ
計測リンクを使用したテストをしています。SDKコンバージョンリスナーを実装しましたが、ログではインストールが全てオーガニックであると表示されます。管理画面上でも非オーガニックインストールが記録されていません。
よくあるエラー要因
- DevKeyが正しくありません。正しくないDevKeyを利用すると、インストールは計測されません。
- 利用している計測リンクが間違っています。計測リンクガイドを参照してください。
- テストに使用している端末がテスト端末に登録されていることをご確認ください。
- マニフェストに不適切なチャネルが定義されていないか確認してください。
Install not detected or attributed
シナリオ
インストールテスト行ったが、ログにはインストールタイプや初回起動などのインストールに関するデータが表示されない。
よくあるエラー要因
- Make sure that the
start
andinit
methods are called in theApplication
class. - テストに使用している端末がテスト端末に登録されていることをご確認ください。
I'm getting a 404 on install or event recording
シナリオ
アプリ内イベントをテストして、正しいメディアソースに紐づけられているかどうかを確認しています。しかし、ログは、インストールの場合も、アプリ内イベントの場合も、404エラーを表示します。インストールもアプリ内イベントも管理画面に表示されません。
よくあるエラー要因
A 404 response indicates that the app ID is incorrect. Make sure that the app ID in the applicationId
parameter in the build.gradle
file is the same as the one in your dashboard.
Revenue is not recorded properly
シナリオ
収益値を含むアプリ内イベントのテストをしています。イベントは管理画面に表示されますが、収益値は計測されません。
よくあるエラー要因
収益パラメータの形式が正しくありません。revenueの値にはどのようなフォーマットも適用しないでください。カンマ区切り、通貨記号、テキストなどを含めないでください。たとえば、収益の値は「1234.56」のように設定してください。
The log shows "AppsFlyer's SDK cannot send any event without providing devkey" when I test in-app events
シナリオ
ログ内のアプリ内イベントをテストしようとしています。イベントをトリガーすると、"AppsFlyer's SDK cannot send any event without providing DevKey"(DevKeyなしでは、イベントを送信できません)というログだけ表示されます。
よくあるエラー要因
You call the start
method without passing the dev key as a parameter. Pass the dev key to the method.
The log shows "not sending data yet, waiting for dev key" in the log when I test in-app events
シナリオ
ログ内のアプリ内イベントをテストしようとしています。イベントをトリガーすると、"Not sending data yet, waiting for dev key"(まだデータを送信していません、DevKeyを待っています)というログだけが表示されます。
よくあるエラー要因
You call the init
and you pass the dev key as an empty string. Pass the dev key to the method.
I get response 400 when I test in-app events
シナリオ
アプリ内イベントをテストしようとしています。イベントを発火するとログに400エラーを確認しました。
よくあるエラー要因
dev keyに問題がある可能性がございます。正しいdev keyを設定しているかご確認ください。dev keyは英数字のみで構成されています。
The log shows "warning: Google play services is missing"
シナリオ
logcatに警告メッセージ "WARNING: Google Play Services is missing"(警告:Google Playサービスがありません) が表示されます。
よくあるエラー要因
Google Play Servicesのdependenciesが設定されていません。そのためSDKがGAIDを取得できず、アトリビューション計測に影響がある可能性がございます。
Add the following dependencies to the app-level build.gradle
file:
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
I get response 403 on install or event recording
シナリオ
log内でインストールやアプリ内イベントのテストを行おうとしている場合、log内でそれらのイベントを発火させると403のエラーレスポンス(forbidden/禁止)が表示されます。
よくあるエラー要因
This might be because you have the Zero package, which does not include attribution data; only data on clicks and impressions. To start receiving attribution data, learn more about the different AppsFlyer packages, and update as needed. You can also contact our customer engagement team at [email protected] if you have questions about our packages.
Androidデバッグアプリの作成
オプション
Android Studioのビルド バリアントを使用して、テスト用に使いやすいデバッグアプリを構成することができます。
すべてのテストは、本番アプリとデバッグアプリの両方で行うことができます。
Step 1: Configure Gradle's debug
build type
In your app-level build.gradle
file, configure the debug
build type and set applicationIdSuffix
to the test app's name (in this case, .debug
).
android {
// ...
buildTypes {
// Prevents a signing error when building the production app
release {
signingConfig signingConfigs.debug
}
debug {
applicationIdSuffix ".debug"
}
}
}
ステップ2:新しいアプリをAppsFlyerに追加
AppsFlyer管理画面にアプリを追加する際に、パッケージ名をアプリIDとして使用してください。または管理画面にアクセスできるチームメンバーに追加を依頼してください。
For example, if you have an app with the package name com.your.app
and you use the Gradle configuration above, the test app's name will be com.your.app.debug
. Pass this name as the app ID when adding the app to AppsFlyer.
更新済 約15時間前。