Prebid不显示配置大小的广告



我正在移动设备上测试Prebid。在我的AdUnit中,我定义了如下维度:

Prebid参数但是,我得到了不同尺寸的广告:

Prebid大小

在我看来,广告商似乎不明白广告是在移动设备上显示的,也许这就是问题所在。可能我忘记了一个参数

我在iFrame中播放了我的拍卖,也许这就是问题所在。

我使用4.25版本。

如果我的帖子不正确或不完整,请告诉我,这是我在stackoverflow上的第一个帖子。

谢谢你的帮助。

问题解决了。你可以在这里看到详细信息:https://github.com/prebid/Prebid.js/issues/6307.

如果您使用的是ImproveDigital适配器,只需在pbjs.setConfig中添加improvedigital: {usePrebidSizes: true}

pbjs.setConfig({ improvedigital: {usePrebidSizes: true} });

我的完整示例在这里:

HTML页面:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="testmobile.js"></script>
</head>
<body>
<div id="b48fef10-6f72-4f83-9a91-77c42069bd87">

</div>
</body>
</html>

javascript代码:

/** add your prebid dll here or in html file **/
let adUnits = [];
let adUnit =
{
code: "b48fef10-6f72-4f83-9a91-77c42069bd87",
mediaTypes: {
banner: {
sizes: [[300,100],[320,100],[320,50],[300,50]]
}
},
bids: [
{
bidder:"onetag",
params:{
pubId:"xxxxxxxxxxxxxxxxx"
}
},
{
bidder:"appnexus",
params:
{
placementId:"xxxxxxxxxxxxxxxxx"
}
},
{
bidder:"improvedigital",
params:
{
placementId:"xxxxxxxxxxxxxxxxx"
}
}]
};
adUnits.push(adUnit);
pbjs.que.push(function () {
pbjs.setConfig({
debug: true,
improvedigital: {usePrebidSizes: true}
});
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: function (bidResponses) {
var winningBids = [];
let ad = pbjs.getHighestCpmBids("b48fef10-6f72-4f83-9a91-77c42069bd87");
if (ad && ad.length > 0) {
let idIFrame = "b48fef10-6f72-4f83-9a91-77c42069bd87frame";
let iFrame = "<iframe id='" + idIFrame + "'"
+ " FRAMEBORDER="0""
+ " SCROLLING="no""
+ " MARGINHEIGHT="0""
+ " MARGINWIDTH="0""
+ " TOPMARGIN="0""
+ " LEFTMARGIN="0""
+ " ALLOWTRANSPARENCY="true""
+ " WIDTH="0""
+ " HEIGHT="0">."
+ " </iframe>"
document.body.innerHTML += '<div id=b48fef10-6f72-4f83-9a91-77c42069bd87>' + iFrame + '</div>';
var iframe = document.getElementById(idIFrame);
var iframeDoc = iframe.contentWindow.document;
try {
pbjs.renderAd(iframeDoc, ad[0]['adId']);
} catch (e) {
console.log(e);
}
winningBids = pbjs.getAllWinningBids();
console.log(winningBids);
} 
else 
{
console.log("No bids");
};
},
timeout: 2000
});
});

最新更新