ad.once(events)

Attach a handler to an event for the ad or elements. The handler is executed at most once per ad or element per event type.

ad.once("render", function() {
  //run only once 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 )};A function to execute at the time the event is triggered.