AdSelectionManager.ReportEvent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Notifies the service that there is a new ad event to report for the ad selected by the
ad-selection run identified by adSelectionId
.
[Android.Runtime.Register("reportEvent", "(Landroid/adservices/adselection/ReportEventRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetReportEvent_Landroid_adservices_adselection_ReportEventRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=35)]
public virtual void ReportEvent (Android.AdServices.AdSelection.ReportEventRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver receiver);
[<Android.Runtime.Register("reportEvent", "(Landroid/adservices/adselection/ReportEventRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetReportEvent_Landroid_adservices_adselection_ReportEventRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=35)>]
abstract member ReportEvent : Android.AdServices.AdSelection.ReportEventRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
override this.ReportEvent : Android.AdServices.AdSelection.ReportEventRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
Parameters
- request
- ReportEventRequest
- executor
- IExecutor
- receiver
- IOutcomeReceiver
- Attributes
Remarks
Notifies the service that there is a new ad event to report for the ad selected by the ad-selection run identified by adSelectionId
. An ad event is any occurrence that happens to an ad associated with the given adSelectionId
. There is no guarantee about when the ad event will be reported. The event reporting could be delayed and reports could be batched.
Using ReportEventRequest#getKey()
, the service will fetch the reportingUri
that was registered in registerAdBeacon
. See documentation of #reportImpression
for more details regarding registerAdBeacon
. Then, the service will attach ReportEventRequest#getData()
to the request body of a POST request and send the request. The body of the POST request will have the content-type
of text/plain
, and the data will be transmitted in charset=UTF-8
.
The output is passed by the receiver, which either returns an empty Object
for a successful run, or an Exception
includes the type of the exception thrown and the corresponding error message.
If the IllegalArgumentException
is thrown, it is caused by invalid input argument the API received to report the ad event.
If the IllegalStateException
is thrown with error message "Failure of AdSelection services.", it is caused by an internal failure of the ad selection service.
If the LimitExceededException
is thrown, it is caused when the calling package exceeds the allowed rate limits and is throttled.
If the SecurityException
is thrown, it is caused when the caller is not authorized or permission is not requested.
Events will be reported at most once as a best-effort attempt.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.