offEvent are provided for you to register
a callback to handle a Prebid.js event.
getEvents method returns a copy of all emitted events.
id parameter provides more finely-grained event
callback registration. This makes it possible to register callback
events for a specific item in the event context.
bidWon events will accept an
id for ad unit code.
bidWon callbacks registered with an ad unit code id will be called
when a bid for that ad unit code wins the auction. Without an
this method registers the callback for every
bidWon is the only event that accepts the
The available events are:
|auctionInit||The auction has started||Object containing auction details|
|auctionEnd||The auction has ended||Object containing auction details|
|beforeRequestBids||Bids are about to be requested from adapters (added in 3.x)||Array of adunits in the auction|
|bidRequested||A bid was requested from a specific bidder||Bid request object|
|bidResponse||A bid response has arrived||Bid response object|
|bidAdjustment||A bid was adjusted||Bid response object|
|bidWon||A bid has won||Bid response object|
|bidTimeout||A bid timed out||Array of objects with timed out bids|
|setTargeting||Targeting has been set||Hash of targeting values|
|requestBids||Bids have been requested from adapters (i.e. pbjs.requestBids() was called)||None|
|addAdUnits||Ad units have been added to the auction||None|
|adRenderFailed||Ad rendering failed||Object containing ‘reason’ and ‘message’|
|auctionDebug||An error was logged to the console||Object containing ‘type’ and ‘arguments’|
|bidderDone||A bidder has signaled they are done responding||Bid request object|
|tcf2Enforcement||There was a TCF2 enforcement action taken||
The examples below show how these events can be used.
Events example 1
Events example 2: Use the optional 3rd parameter for the
Events example 3: Dynamically modify the auction
Events example 4: Log errors and render fails to your own endpoint