问题描述
` <html>
<head>
<link rel="icon" type="image/png" href="/favicon.png">
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
<script async src="//acdn.adnxs.com/prebid/not-for-prod/prebid.js"></script>
<script>
var div_1_sizes = [
[300,250],[300,600]
];
var div_2_sizes = [
[728,90],[970,250]
];
var PREBID_TIMEOUT = 5000;
var FAILSAFE_TIMEOUT = 3000;
var adUnits = [
{
code: '/19968336/header-bid-tag-0',mediaTypes: {
banner: {
sizes: div_1_sizes
}
},bids: [{
bidder: 'appnexus',params: {
placementId: 13144370
}
},{
bidder: 'rubicon',params: {
accountId: 14062,siteId: 70608,zoneId: 498816
}
},{
bidder: 'sovrn',params: {
tagid: '403401'
}
}
]
},{
code: '/19968336/header-bid-tag-1',mediaTypes: {
banner: {
sizes: div_2_sizes
}
},params: {
placementId: 13144370
}
}
]
}
];
// ======== DO NOT EDIT BELOW THIS LINE =========== //
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,timeout: PREBID_TIMEOUT
});
});
pbjs.setConfig({
s2sConfig: {
accountId : '1',bidders : ['appnexus','sovrn','rubicon'],defaultvendor: 'appnexus',timeout: 300
}
});
function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.settargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}
// in case PBJS doesn't load
setTimeout(function() {
initAdserver();
},FAILSAFE_TIMEOUT);
googletag.cmd.push(function() {
googletag.defineslot('/19968336/header-bid-tag-0',div_1_sizes,'div-1').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
googletag.cmd.push(function() {
googletag.defineslot('/19968336/header-bid-tag-1',div_2_sizes,'div-2').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>
<body>
<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>
<div id='div-1'>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.display('div-1');
});
</script>
</div>
<br>
<h5>Div-2</h5>
<div id='div-2'>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.display('div-2');
});
</script>
</div>
</body>
</html>`
我已经使用包含3个竞标者appnexus,sovrn,rubicon和s2s配置的prebid创建了js文件。 上面是我创建的代码
1)but i am not getting ad delivered when i add the below lines of code in my js which i shared above pbjs.setConfig
2)when I remove appnexus and rubicon I am getting only house ad instead of sovrn ad.
Can anyone tell hhow to fix these both errors?
1)但是,当我在pbjs.setConfig上方共享的js中添加以下代码行时,我没有得到广告投放
2)when I remove appnexus and rubicon I am getting only house ad instead of sovrn ad.
Can anyone tell hhow to fix these both errors?
1)但是,当我在pbjs.setConfig上方共享的js中添加以下代码行时,我没有得到广告投放
2)when I remove appnexus and rubicon I am getting only house ad instead of sovrn ad.
Can anyone tell hhow to fix these both errors?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)