我正在尝试在我的网站上设置 prebid 并使用 prebid 网站的示例代码。目前我有 appnexus 和 Adx,这是控制台中的流程: https ://i.imgur.com/qme7k26.png
正如您在上图中看到的那样,除了没有尝试设置键值外,流程是完美的。
预期的流程应该是这样的: https ://i.imgur.com/4oPnacA.png
我不知道这是什么原因造成的。
下面是我的代码:
var unit_728x90 = [
[728, 90],
[600, 300]
];
var unit_300x250 = [
[336, 280],
[300, 250],
[300, 100],
[320, 50]
];
var unit_320x50 = [
[320, 50]
];
var unit_300 = [
[300, 250]
];
var PREBID_TIMEOUT =2000;
var FAILSAFE_TIMEOUT = 3000;
var ASSERT_TIMEOUT = 1000;
var adUnits = [{
code: '21791303143/upl_belowslidem_300x250',
mediaTypes: {
banner: {
sizes: unit_300x250
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 17076422
}
}]
}
];
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
if(window.screen.width < 769){
googletag.cmd.push(function() {
});
}else{
googletag.cmd.push(function() {
googletag.defineSlot('/21791303143/upl_belowslidem_300x250', unit_300x250, 'div-side').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
}
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.setConfig({
priceGranularity: "high",
enableSendAllBids: false,
useBidCache: true
})
});
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver;
}
});
});
function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync('div-side');
googletag.pubads().refresh();
});
});
}
setTimeout(function() {
initAdserver();
}, FAILSAFE_TIMEOUT);