【发布时间】:2025-12-08 17:45:01
【问题描述】:
我正在尝试使用每千次展示费用调整在我的标头出价合作伙伴之间创造一个公平的竞争环境,其中一些提供净出价,一些提供总出价。
我已经按照 Prebid 网站上的文档进行了设置,但我认为它不起作用。
当我使用pbjs_debug=true URL 参数并查看控制台时,我没有看到任何迹象表明正在调整出价。
是不是我设置错了?或者有没有更好的方法来验证 CPM 是否得到了调整?
<script>
var PREBID_TIMEOUT = 1500;
var adUnits = [{
code: 'div-gpt-ad-1487305430432-0',
mediaTypes: {
banner: {
sizes: [[300, 250]],
},
},
bids: [
{
/* **snip** */
}],
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
</script>
<!-- Prebid Config Section END -->
<!-- Prebid Boilerplate Section START. No Need to Edit. -->
<script type="text/javascript" src="/js/prebid.1.20.0.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
pbjs.bidderSettings = [
{
districtm: {
bidCpmAdjustment: function(bidCpm) {
return bidCpm * 0.85;
},
},
}];
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
// pbjs.setPriceGranularity('low');
const customConfigObject = {
'buckets': [{
'precision': 2, //default is 2 if omitted - means 2.1234 rounded to 2 decimal places = 2.12
'min': 0,
'max': 14,
'increment': 0.01,
}],
};
//set custom config objec
pbjs.setConfig({ priceGranularity: customConfigObject });
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
});
});
function sendAdserverRequest() {
if (pbjs.adserverRequestSent) {
return;
}
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
setTimeout(function() {
sendAdserverRequest();
}, PREBID_TIMEOUT);
</script>
【问题讨论】:
标签: prebid.js