ad.on(events)

Attach an event handler function for one or more events to the ad.

ad.on("render", function() {
  //run when the ad renders
});

Arguments

ArugmentValueExample ValueDescription
eventsstringrenderOne or more space-separated event types and optional namespaces, such as "click" or "alter:adVisible"
callbackfunctionfunction() ({ //callback code to run });A function to execute at the time the event is triggered.