Freigeben über


Off Event

This function clears the event listeners on the given eventType and targetId.

offEvent('eventType','targetId')

The parameters listed below can be sent as arguments in the function.

Parameter Type Description
eventType string The event to listen for on the tag.
- adRequested: An ad was requested from the Impression Bus.
- adAvailable: A creative was returned from the Impression Bus but has not yet been shown.
- adBadRequest: The tag called a placement that doesn't exist.
- adLoaded: An ad placement has been fully defined and is ready to be shown; apn.showTag has been successfully executed.
- adNoBid: No bid was received for the ad tag.
- adRequestFailure: Failure to retrieve the creative. Could indicate a problem with the setup of the ad tag, or a problem contacting the endpoint.
- adError: Error caused by the creative itself (any first or third party in the chain) that was delivered by AST. Note that the ad may still be shown.
- adCollapse: Can be triggered by the creative, if the creative contains window.parent.apntag.collapseAd(document.body.id).
targetId string The unique identifier of a specific ad slot. Omit this parameter to disable all the callback functions to be executed for this eventType. This is an optional parameter.

Example

apntag.offEvent('adError','apn_ad_slot_1');
 
apntag.offEvent('adError');