AdRequestedEvent

interface AdRequestedEvent { demand: AdDemand; id: string; refresh: boolean; requestId: string; }

CustomEvent type for 'nitroAds.adRequested' event. Fired when an ad request starts for a placement. Every adRequested is followed by exactly one AdResultEvent with the same requestId.

Example

CODE
document.addEventListener('nitroAds.adRequested', (event) => {
    console.log(`${event.detail.id} requested via ${event.detail.demand}`);
});

Properties

demand: AdDemand

Demand path serving the request

id: string

Placement id

refresh: boolean

True if this request is a refresh of the placement

requestId: string

Ad request id