-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question/Bug?] onBidWon is not called when my adapter won the auction #6026
Comments
Hi @sebbes-at-missena I'm also developing an adapter (only native support), but ended up at the same point where you are. #6010 If you like we can join forcess and discuss in pvt ( discord? ). Two heads are better than one |
Just to make sure we're on the same page: onBidWon is called on With ?pbjs_debug=true, if you see the call to render, then you should see onBidWon() called. Getting the ad to render means having your line items set up correctly in the ad server. Or if you're using Post-Bid, then calling render yourself. |
ok thanks @bretg , I tottally missed the fact I had to call the Thank you for you answer! For the record, here is the updated working html file: <html>
<head>
<link rel="icon" type="image/png" href="/favicon.png" />
<!-- <script async src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js"></script> -->
<script
type="text/javascript"
src="../../build/dev/prebid.js"
async
></script>
<script>
window.pbjs = window.pbjs || {};
window.pbjs.que = window.pbjs.que || [];
var bidCallback = function (bidResponses) {
console.log("adwdebug bidCallback", bidResponses);
var winner = pbjs.getAdserverTargetingForAdUnitCode(
"missena-ad-unit-code"
);
var sspWinner = winner["hb_bidder"];
var cpm = parseFloat(winner["hb_pb"]);
console.log("winner : ", sspWinner, ", at that price : ", cpm, winner);
var iframe = document.getElementById('div-1');
if (winner && winner['hb_adid']) {
iframe.parentElement.style.position = "relative";
iframe.style.display = "block";
pbjs.renderAd(iframe.contentDocument, winner['hb_adid']);
}
};
var PREBID_TIMEOUT = 3000;
var date = new Date().getTime();
pbjs.que.push(function () {
pbjs.setConfig({
debug: true,
userSync: {
iframeEnabled: true,
},
});
var adUnits = [
{
code: "missena-ad-unit-code",
mediaTypes: {
banner: {
sizes: [1, 1],
},
},
bids: [
{
bidder: "missena",
params: {},
},
],
},
];
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: bidCallback,
});
});
</script>
<script></script>
</head>
<body>
<h2>Prebid Native</h2>
<iframe id="div-1">
<p>No response</p>
</iframe>
</body>
</html> |
Type of issue
Question/Bug
Description
I'm building an adapter which defines an
onBidWon
method. However, this method doesn't seem to be called when the adapter win the auction (in this method, I perform some logs which don't appear at all in the console, even if I have logs telling me I won the auction).Below are the adapter I have so far and the testing page I use.
The text was updated successfully, but these errors were encountered: