ReportEventRequest


open class ReportEventRequest
kotlin.Any
   ↳ android.adservices.adselection.ReportEventRequest

Request object wrapping the required arguments needed to report an ad event.

Summary

Nested classes

Builder for ReportEventRequest objects.

Constants
static Int

static Int

Public methods
open Long

Returns the adSelectionId, the primary identifier of an ad selection process.

open String

Returns the ad event data.

open InputEvent?

Returns the input event associated with the user interaction.

open String

Returns the event key, the type of ad event to be reported.

open Int

Returns the bitfield of reporting destinations to report to (buyer, seller, or both).

Constants

FLAG_REPORTING_DESTINATION_BUYER

static val FLAG_REPORTING_DESTINATION_BUYER: Int
Value: 2

FLAG_REPORTING_DESTINATION_SELLER

static val FLAG_REPORTING_DESTINATION_SELLER: Int
Value: 1

Public methods

getAdSelectionId

open fun getAdSelectionId(): Long

Returns the adSelectionId, the primary identifier of an ad selection process.

getData

open fun getData(): String

Returns the ad event data.

After ad selection, this data is generated by the caller. The caller can then call android.adservices.adselection.AdSelectionManager#reportEvent. This data will be attached in a POST request to the reportingUri registered in registerAdBeacon.

The size of String#getBytes() in UTF-8 format should be below 64KB.

Return
String This value cannot be null.

getInputEvent

open fun getInputEvent(): InputEvent?

Returns the input event associated with the user interaction.

This field is either null, representing a view event, or has an InputEvent object, representing a click event.

getKey

open fun getKey(): String

Returns the event key, the type of ad event to be reported.

This field will be used to fetch the reportingUri associated with the eventKey registered in registerAdBeacon after ad selection.

This field should be an exact match to the eventKey registered in registerAdBeacon. Specific details about registerAdBeacon can be found at the documentation of AdSelectionManager#reportImpression

The event key (when inspecting its byte array with String#getBytes()) in UTF-8 format should not exceed 40 bytes. Any key exceeding this limit will not be registered during the registerAdBeacon call.

Return
String This value cannot be null.

getReportingDestinations

open fun getReportingDestinations(): Int

Returns the bitfield of reporting destinations to report to (buyer, seller, or both).

To create this bitfield, place an | bitwise operator between each reportingDestination to be reported to. For example to only report to buyer, set the reportingDestinations field to FLAG_REPORTING_DESTINATION_BUYER To only report to seller, set the reportingDestinations field to FLAG_REPORTING_DESTINATION_SELLER To report to both buyers and sellers, set the reportingDestinations field to FLAG_REPORTING_DESTINATION_BUYER | FLAG_REPORTING_DESTINATION_SELLER

Return
Int Value is either 0 or a combination of android.adservices.adselection.ReportEventRequest#FLAG_REPORTING_DESTINATION_SELLER, and android.adservices.adselection.ReportEventRequest#FLAG_REPORTING_DESTINATION_BUYER