prebid.js - 无法判断 Prebid CPM 调整是否有效
问题描述
我正在尝试使用每千次展示费用调整在我的标头出价合作伙伴之间创建一个公平的竞争环境,其中一些提供净出价,一些提供总出价。
我已经按照 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>
解决方案
在控制台上运行以下代码:
pbjs.bidderSettings.{{bidder_code}}.bidCpmAdjustment(100)
在您的情况下,bidder_code 可以是“区”。这将返回 85,即 85%。
您还可以通过运行来验证出价响应:
pbjs.getBidResponses()
如果该特定投标人的 bidcpmadjustment 不是 100%,您可以在此处看到 netRevenue 为假。
推荐阅读
- laravel - 密码重置后Laravel重定向到登录页面
- java - 使用 java lang Object 类型作为数据类型的 Avro 模式
- angular - 如何在 formBuilder Angular 中添加条件验证器
- android - 使用 android AudioRecord 获取 32 位样本?
- java - indexof 的索引超出范围异常
- bash - 在 bash 脚本中找不到语法错误?
- azure-devops - Azure DevOps 如何定义 YAML 构建路径
- python - 使用 f-strings python 格式化具有相同宽度的数字
- ios - Scandit SDK 在扫描一维条码时出现的奇怪问题
- node.js - 为什么填充在 mongodb 中返回空结果