Setting a maximum bid
Looking at the custom bucket example and docs here: http://prebid.org/dev-docs/examples/custom-price-bucket.html and here: http://prebid.org/dev-docs/publisher-api-reference.html#module_pbjs.bidderSettings
I'm trying to put together the simplest way to define a maximum bid.
For the sake of example, let's say we only have line items up to $11.00. I want to make sure anything below that is set to 11.00.
I need to adjust most bids (net/gross or currency exchange). So I was wondering if this would do the trick:
pbjs.bidderSettings = {
// all my one-by-one partner adjustments,
standard: {
adserverTargeting: [{
key: "hb_pb",
val: function(bidResponse) {
var cpm = bidResponse.cpm;
if (cpm > 11.00) {
return '11.00';
}
}
}]
}
}
@dmsinger I think this would do what you want:
if (cpm >= 11.00) {
return '11.00';
}
else{
//use mechanism to round price
return bidResponse.pbMg;
}
Choice the appropriate rounding you want in the else statement with using pbLg, pbMg, pbHg
Thanks, looks good. Just need to reverse the => to >= (or just keep it to > if 11.00 is set).
I get this error:
ERROR: Error trying to write ad Id : to the page. Missing document or adId
Edit: I had to add both hb_adid, and hb_bidder to adserverTargeting.