Skip to content

Commit

Permalink
Prebid Core: Update renderAd to use hook prebid#7091
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnewton authored and agrandes-tappx committed Sep 29, 2021
1 parent 6910c60 commit 5461653
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ function emitAdRenderFail({ reason, message, bid, id }) {
* @param {string} id bid id to locate the ad
* @alias module:pbjs.renderAd
*/
$$PREBID_GLOBAL$$.renderAd = function (doc, id, options) {
$$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) {
utils.logInfo('Invoking $$PREBID_GLOBAL$$.renderAd', arguments);
utils.logMessage('Calling renderAd with adId :' + id);

Expand Down Expand Up @@ -488,7 +488,7 @@ $$PREBID_GLOBAL$$.renderAd = function (doc, id, options) {
const message = `Error trying to write ad Id :${id} to the page. Missing document or adId`;
emitAdRenderFail({ reason: MISSING_DOC_OR_ADID, message, id });
}
};
});

/**
* Remove adUnit from the $$PREBID_GLOBAL$$ configuration, if there are no addUnitCode(s) it will remove all
Expand Down

0 comments on commit 5461653

Please sign in to comment.