AdLoadReporter

class AdLoadReporter(telemetryRepository: TelemetryRepository, buildInfoRepository: BuildInfoRepository)(source)

The one place an ad that failed to load is written down.

An empty ad slot is silent by design: the SDK reports the failure to a callback and the UI simply renders nothing. That is right for users and useless for anyone trying to work out why a slot is blank, because no-fill, a misconfigured unit id and an SDK that was never initialized all look identical from the outside. Every toolkit ad surface routes its failures through here so the three can be told apart afterwards.

Logcat carries the detail during development. Crashlytics gets a breadcrumb for every failure and a non-fatal only for the failures a developer can act on, so a device with no fill does not report an issue on every scroll.

Constructors

Link copied to clipboard
constructor(telemetryRepository: TelemetryRepository, buildInfoRepository: BuildInfoRepository)

Properties

Link copied to clipboard

True when an empty slot should explain itself on screen. Debug builds only.

Functions

Link copied to clipboard
fun onAdFailedToLoad(slotName: String, adUnitId: String, errorCode: String, errorMessage: String)

Records that adUnitId came back without an ad.

Link copied to clipboard
fun onAdRequestNotStarted(slotName: String, adUnitId: String, throwable: Throwable? = null)

Records that the request was never made, which is always a defect on our side.