Stay organized with collections
Save and categorize content based on your preferences.
ReportImpressionRequest
open class ReportImpressionRequest
Represent input parameters to the reportImpression API.
Summary
Public constructors |
Ctor for auction server ad selection reporting request.
|
Ctor for on-device ad selection reporting request.
|
Public constructors
ReportImpressionRequest
ReportImpressionRequest(adSelectionId: Long)
Ctor for auction server ad selection reporting request.
If your adSelectionId
is for a server auction run where device info collected by AdSelectionManager.getAdSelectionData
then your impression reporting request should only include the ad selection id.
AdSelectionManager.persistAdSelectionResult
must be called with the encrypted result blob from servers before making impression reporting request.
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ReportImpressionRequest\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)\n\nReportImpressionRequest\n=======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/adselection/ReportImpressionRequest \"View this page in Java\") \n\n```\nopen class ReportImpressionRequest\n```\n\n|---|-------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.adservices.adselection.ReportImpressionRequest](#) |\n\nRepresent input parameters to the reportImpression API.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ReportImpressionRequest](#ReportImpressionRequest(kotlin.Long))`(`adSelectionId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Ctor for auction server ad selection reporting request. |\n| [ReportImpressionRequest](#ReportImpressionRequest(kotlin.Long,%20android.adservices.adselection.AdSelectionConfig))`(`adSelectionId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `adSelectionConfig:` `[AdSelectionConfig](/reference/kotlin/android/adservices/adselection/AdSelectionConfig)`)` Ctor for on-device ad selection reporting request. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| open [AdSelectionConfig](/reference/kotlin/android/adservices/adselection/AdSelectionConfig) | [getAdSelectionConfig](#getAdSelectionConfig())`()` Returns the adSelectionConfig, one of the inputs to [ReportImpressionRequest](#) |\n| open [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getAdSelectionId](#getAdSelectionId())`()` Returns the adSelectionId, one of the inputs to [ReportImpressionRequest](#) |\n\nPublic constructors\n-------------------\n\n### ReportImpressionRequest\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nReportImpressionRequest(adSelectionId: Long)\n```\n\nCtor for auction server ad selection reporting request.\n\nIf your `adSelectionId` is for a server auction run where device info collected by [AdSelectionManager.getAdSelectionData](/reference/kotlin/android/adservices/adselection/AdSelectionManager#getAdSelectionData(android.adservices.adselection.GetAdSelectionDataRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) then your impression reporting request should only include the ad selection id.\n\n[AdSelectionManager.persistAdSelectionResult](/reference/kotlin/android/adservices/adselection/AdSelectionManager#persistAdSelectionResult(android.adservices.adselection.PersistAdSelectionResultRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) must be called with the encrypted result blob from servers before making impression reporting request.\n\n| Parameters ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `adSelectionId` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): received from [AdSelectionManager.getAdSelectionData](/reference/kotlin/android/adservices/adselection/AdSelectionManager#getAdSelectionData(android.adservices.adselection.GetAdSelectionDataRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) |\n\n### ReportImpressionRequest\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nReportImpressionRequest(\n adSelectionId: Long, \n adSelectionConfig: AdSelectionConfig)\n```\n\nCtor for on-device ad selection reporting request.\n\nIf your `adSelectionId` is for a on-device auction run using [android.adservices.adselection.AdSelectionManager#selectAds(android.adservices.adselection.AdSelectionConfig,java.util.concurrent.Executor,android.os.OutcomeReceiver)](/reference/kotlin/android/adservices/adselection/AdSelectionManager#selectAds(android.adservices.adselection.AdSelectionConfig,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) then your impression reporting request must include your [AdSelectionConfig](/reference/kotlin/android/adservices/adselection/AdSelectionConfig).\n\n| Parameters ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `adSelectionId` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): received from [AdSelectionManager.selectAds(AdSelectionConfig,](/reference/kotlin/android/adservices/adselection/AdSelectionManager#selectAds(android.adservices.adselection.AdSelectionConfig,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) |\n| `adSelectionConfig` | [AdSelectionConfig](/reference/kotlin/android/adservices/adselection/AdSelectionConfig): same [AdSelectionConfig](/reference/kotlin/android/adservices/adselection/AdSelectionConfig) used to trigger [android.adservices.adselection.AdSelectionManager#selectAds(android.adservices.adselection.AdSelectionConfig,java.util.concurrent.Executor,android.os.OutcomeReceiver)](/reference/kotlin/android/adservices/adselection/AdSelectionManager#selectAds(android.adservices.adselection.AdSelectionConfig,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)) This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### getAdSelectionConfig\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nopen fun getAdSelectionConfig(): AdSelectionConfig\n```\n\nReturns the adSelectionConfig, one of the inputs to [ReportImpressionRequest](#)\n\n| Return ||\n|-----------------------------------------------------------------------------------------|------------------------------|\n| [AdSelectionConfig](/reference/kotlin/android/adservices/adselection/AdSelectionConfig) | This value cannot be `null`. |\n\n### getAdSelectionId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nopen fun getAdSelectionId(): Long\n```\n\nReturns the adSelectionId, one of the inputs to [ReportImpressionRequest](#)"]]