報告事件要求
public
class
ReportEventRequest
extends Object
| java.lang.Object | |
| ↳ | android.adservices.adselection.ReportEventRequest |
這是要求物件,可包裝回報廣告事件所需的必要引數。
摘要
巢狀類別 | |
|---|---|
class |
ReportEventRequest.Builder
|
常數 | |
|---|---|
int |
FLAG_REPORTING_DESTINATION_BUYER
|
int |
FLAG_REPORTING_DESTINATION_SELLER
|
公用方法 | |
|---|---|
long
|
getAdSelectionId()
傳回 adSelectionId,亦即廣告選擇程序的主要 ID。 |
String
|
getData()
傳回廣告事件資料。 |
InputEvent
|
getInputEvent()
傳回與使用者互動相關聯的輸入事件。 |
String
|
getKey()
傳回事件鍵,亦即要回報的廣告事件類型。 |
int
|
getReportingDestinations()
傳回要回報到哪個報表目的地的位元欄位 (買方、賣方或兩者)。 |
繼承方法 | |
|---|---|
常數
FLAG_REPORTING_DESTINATION_BUYER
public static final int FLAG_REPORTING_DESTINATION_BUYER
常數值: 2 分 (0x00000002)。
FLAG_REPORTING_DESTINATION_SELLER
public static final int FLAG_REPORTING_DESTINATION_SELLER
常數值: 1 分 (0x00000001)
公用方法
getAdSelectionId
public long getAdSelectionId ()
傳回 adSelectionId,亦即廣告選擇程序的主要 ID。
| 傳回 | |
|---|---|
long |
|
getData
public String getData ()
傳回廣告事件資料。
廣告選擇程序結束後,呼叫端會產生這項資料。接著,呼叫端就可以呼叫 AdSelectionManager.reportEvent(ReportEventRequest, Executor, OutcomeReceiver)。這項資料會透過 POST 要求附加至在 registerAdBeacon 註冊的 reportingUri。
UTF-8 格式的 String#getBytes() 大小不得超過 64 KB。
| 傳回 | |
|---|---|
String |
此值不能為 null。 |
getInputEvent
public InputEvent getInputEvent ()
傳回與使用者互動相關聯的輸入事件。
這個欄位可以是代表檢視畫面的 null,也可以是代表點擊事件的 InputEvent 物件。
| 傳回 | |
|---|---|
InputEvent |
|
getKey
public String getKey ()
傳回事件鍵,亦即要回報的廣告事件類型。
這個欄位將會用來擷取與 eventKey 相關聯的 reportingUri (廣告選擇程序結束後,interactionReportingUri 已於 registerAdBeacon 註冊)。
這個欄位必須與 registerAdBeacon 中註冊的 eventKey 完全相符。如要查看「registerAdBeacon」的特定詳細資料,請前往:
「AdSelectionManager#reportImpression」的說明文件
在 UTF-8 格式中使用 String#getBytes() 檢查其位元組陣列時,事件索引鍵不得超過 40 個位元組。系統不會註冊超出這項限制的金鑰
registerAdBeacon。
| 傳回 | |
|---|---|
String |
此值不能為 null。 |
getReportingDestinations
public int getReportingDestinations ()
傳回要回報到哪個報表目的地的位元欄位 (買方、賣方或兩者)。
如要建立這個位元欄位,請在每個要收到回報的 reportingDestination 之間置入 | 位元運算子。舉例來說,如果只要向買方回報,請將
ReportingDestinations 欄位,FLAG_REPORTING_DESTINATION_BUYER 只回報給
賣方請將 reportDestinations 欄位設為 FLAG_REPORTING_DESTINATION_SELLER
因此,請將 reportDestinations 欄位設為 FLAG_REPORTING_DESTINATION_BUYER |FLAG_REPORTING_DESTINATION_SELLER
| 傳回 | |
|---|---|
int |
值可以是 0 或 FLAG_REPORTING_DESTINATION_SELLER 的組合,以及 FLAG_REPORTING_DESTINATION_BUYER |