Programming Adrelevantis Bidder Adapter is the same as other Prebid.js Bidder Adapters. The only difference is when the bid process starts. Normally, header bidding begins as soon as the page loads within the user’s browser. For Adrelevantis Bidder Adapter, the bidding starts in the event handler of DOMContentLoaded
event. The reason is that Adrelevantis Bidder Adapter needs to access to the page content to match ads based on the content.
document.addEventListener("DOMContentLoaded", function(event){ adrtags("D435C107A8844E15BAA5D4A9B7D94FC5", adUnits, adDivIds); });
The above code is excerpted from programming examples at Ads relevant to content with Adrelevantis bidder adapter in GitHub.
There are a few implications. By putting adrtags
function in DOMContentLoaded
event handler, it can extract and parse the page content, then, search ads based on the content, and display ads. By starting bid until the document has been loaded, it also alleviates the concerns that the bidding process competes with page load. The user gets more responsive page loading experience.
Please go to GitHub open source for complete examples at https://github.com/ghguo/adrhbexamples.
Please contact us for more information at info@adrelevantis.com.