[英]Using Prebid's price granularity high
We have our Price Granularity for Prebid set to high. 我们将竞价的价格粒度设置为高。 However, since it's capped at $20, if we get a bid for $30 or $40 we're unable to accept it. 但是,由于它的上限是20美元,因此如果我们出价30美元或40美元,我们将无法接受。
How can we stick with Price Granularity high with Prebid, but in instances we have a bid north of $20, automatically round down to $20 so that we can accept the bid. 我们如何在Prebid中将价格粒度保持在较高水平,但是在某些情况下,我们的出价在20美元以北,因此会自动舍入为20美元,以便我们接受出价。
Thank you.. 谢谢..
According to Prebid documentation is should already be rounded down, but you can explicitly control it by adding the following code. 根据Prebid文档,应该已经对它进行了四舍五入,但是您可以通过添加以下代码来显式地控制它。
Assuming you're using the standard Prebid targeting keys 假设您使用的是标准的Prebid定位键
pbjs.bidderSettings.standard = {
adserverTargeting: [{
key: 'hb_bidder',
val: function val(bidResponse) {
return bidResponse.bidderCode;
}
}, {
key: 'hb_adid',
val: function val(bidResponse) {
return bidResponse.adId;
}
}, {
key: 'hb_pb',
val: function val(bidResponse) {
var cpm = bidResponse.cpm;
if (cpm > 20.00) {
return 20.00;
}
return (Math.floor(cpm * 100) / 100).toFixed(2);
}
}]
};
Add this after pbjs.addAdUnits( ad_units ) 将其添加到pbjs.addAdUnits(ad_units)之后
You'll want to use the custom setting instead of using high to get what you want 您将要使用自定义设置,而不是使用high来获取所需的内容
See an example here: http://prebid.org/dev-docs/publisher-api-reference.html#customCPMObject 在此处查看示例: http : //prebid.org/dev-docs/publisher-api-reference.html#customCPMObject
For the JSON youll want to redefine the same granularity settings for high in that JSON object and then add upon it to get additional granularity > $20. 对于JSON,您需要为该JSON对象中的high重新定义相同的粒度设置,然后对其进行添加以获取大于20美元的其他粒度。
Pro tips: 专业提示:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.