postMetricsData

fun postMetricsData(data: Set<Metrics>, loadId: String? = null, queueId: String? = null, loadStart: Long? = null, backgroundDurationMs: Long? = null, eventResult: EventResult? = null, adEventTrackers: Map<TrackingEvent, List<ServerEventTracker>> = emptyMap())

Post metrics data payload to the server on an ad lifecycle event basis.

This function sends tracking data related to ad lifecycle events to the server. It handles both global and ad-specific event trackers. Global trackers are always processed, even if adEventTrackers is empty. This ensures that essential tracking data is sent, regardless of whether ad-specific trackers are present. Ad-specific trackers, if provided, are processed in addition to the global ones.

Parameters

data

The metrics data payload for a specific ad lifecycle event.

loadId

The load ID for the ad lifecycle event.

loadStart

The start time, in milliseconds, of a load.

backgroundDurationMs

The amount of time, in milliseconds, that a load was being performed while the app was in the background.

eventResult

The result of the ad lifecycle event.

adEventTrackers

A map of event trackers specific to this ad. This map may be empty, in which case only global event trackers will be processed.