Play Install Referrer API
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このドキュメントでは、Play Install Referrer API の使用に関するテクニカル情報を紹介します。Play Install Referrer API は AIDL サービス インターフェースで、主に Java 以外のプログラマーによって使用されます。
注: Play Install Referrer Library は Play Install Referrer API のラッパーを提供し、Java プログラマーが API を利用しやすくするように設計されています。
getInstallReferrer() メソッド
このメソッドは、Bundle
(表 1 にマッピングされているキー)で送信される特定のパッケージ名に対応する、アプリのインストール リファラー情報を返します。Google Play から送信されるレスポンスの Bundle
では、キー(表 2 を参照)にマッピングされているフィールドにリファラー情報が格納されます。
表 1. getInstallReferrer()
によるバンドルデータのリクエスト
パラメータ
|
タイプ
|
説明
|
package_name
|
String
|
呼び出し元のパッケージ名。曖昧さ回避に使用されます。 |
表 2. getInstallReferrer()
リクエストに対するレスポンス データ
キー
|
タイプ
|
説明
|
install_referrer
|
String
|
インストールされたパッケージのリファラー URL。
|
referrer_click_timestamp_seconds
|
long
|
リファラー クリックが発生したときのクライアント側のタイムスタンプ(秒単位)。
|
install_begin_timestamp_seconds
|
long
|
アプリのインストールが開始されたときのクライアント側のタイムスタンプ(秒単位)。 |
referrer_click_timestamp_server_seconds
|
long
|
参照 URL のクリックが発生したときのサーバーサイドのタイムスタンプ(秒単位)。
|
install_begin_timestamp_server_seconds
|
long
|
アプリのインストールが開始されたときのサーバー側のタイムスタンプ(秒単位)。 |
install_version
|
string
|
アプリが最初にインストールされた時点でのアプリのバージョン。 |
google_play_instant
|
boolean
|
アプリの Instant エクスペリエンスが過去 7 日以内に起動されたかどうかを示します。 |
注意: インストール リファラー情報の使用可能期間は 90 日です。この情報は、アプリが再インストールされない限り変更されません。アプリで不要な API 呼び出しが行われないようにするには、インストール後の最初の実行時に API を 1 回だけ呼び出します。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# Play Install Referrer API\n\nThis documentation provides technical reference for using the\nPlay Install Referrer API. The Play Install Referrer API is an\n[AIDL Service Interface](https://developer.android.com/guide/components/aidl.html)\nprimarily used by non-Java programmers.\n\n\n**Note:** The\n[Play Install Referrer Library](/google/play/installreferrer/library)\nprovides a wrapper around the Play Install Referrer API and is designed to help Java\nprogrammers use the API.\n\nThe getInstallReferrer() method\n-------------------------------\n\nThis method returns the app install referrer information corresponding to the\ngiven package name sent through a `Bundle` (key mapped in table 1). In the\nresponse `Bundle` sent by Google Play, the referral information is stored in\nfields mapped to the keys detailed in table 2.\n\n\n**Table 1.** `getInstallReferrer()` bundle data\nrequest.\n\n| Parameter | Type | Description |\n|----------------|----------|----------------------------------------------------------|\n| `package_name` | `String` | The package name of the caller, used for disambiguation. |\n\n\n**Table 2.** Response data from a `getInstallReferrer()`\nrequest.\n\n| Key | Type | Description |\n|-------------------------------------------|-----------|--------------------------------------------------------------------------------------|\n| `install_referrer` | `String` | The referrer URL of the installed package. |\n| `referrer_click_timestamp_seconds` | `long` | The client-side timestamp, in seconds, when the referrer click happened. |\n| `install_begin_timestamp_seconds` | `long` | The client-side timestamp, in seconds, when app installation began. |\n| `referrer_click_timestamp_server_seconds` | `long` | The server-side timestamp, in seconds, when the referrer click happened. |\n| `install_begin_timestamp_server_seconds` | `long` | The server-side timestamp, in seconds, when app installation began. |\n| `install_version` | `string` | The app's version at the time when the app was first installed. |\n| `google_play_instant` | `boolean` | Indicates whether your app's instant experience was launched within the past 7 days. |\n\n**Caution:** The install referrer information will be\navailable for 90 days and **won't change** unless the application is\nreinstalled. To avoid unnecessary API calls in your app, you should invoke the\nAPI **only once** during the first execution after install."]]