所以我今天早上注意到了这一点,因为我们的 AdSense 已被暂时禁用,因此我的网站上有很多可用的广告空间。我注意到,如果我去我的网站并四处浏览,我会从 Rubicon/Magnite 收到出价,但根本没有广告被填写。显然,我们预计是否有一个出价至少应该显示该广告,我担心这会在更大范围内影响我的填充率。有些广告确实会呈现——我们正在创造收入,所以它们一定会呈现——但我不确定为什么会发生这种情况。
这是我使用推荐的 UAM 和 prebid 并行设置的设置:
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var gptAdSlots = [];
googletag.cmd.push(function() {
var top = googletag.sizeMapping().addSize([1000,0],[[728,90],]).addSize([768,0],[[728,90],[468,60],]).addSize([468,0],[[468,60],[320,100],[320,50],]).addSize([300,0],[[320,100],[320,50],]).
build();
gptAdSlots[0] = googletag.defineSlot("/pubid/parentadunit/adunit",[[728,90],[468,60],[320,100],[320,50]],"ADUNITLeaderboard").defineSizeMapping(top).
setTargeting("position", ["leaderboard-1"]).
setTargeting("tags", []).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.pubads().enableAsyncRendering();
googletag.pubads().enableVideoAds();
googletag.pubads().setCentering(true);
googletag.pubads().disableInitialLoad();
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
//load the apstag.js library
!function(a9,a,p,s,t,A,g){if(a[a9])return;function q(c,r){a[a9]._Q.push([c,r])}a[a9]={init:function(){q("i",arguments)},fetchBids:function(){q("f",arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},_Q:[]};A=p.createElement(s);A.async=!0;A.src=t;g=p.getElementsByTagName(s)[0];g.parentNode.insertBefore(A,g)}("apstag",window,document,"script","//c.amazon-adsystem.com/aax2/apstag.js");
//initialize the apstag.js library on the page to allow bidding
apstag.init({
pubID: pubidhere,
adServer: "googletag",
simplerGPT: true
});
var topsizes = [
[970,250],[728,90],[320,100],[320,50]
];
var adUnits = [{
code: 'ADUNITLeaderboard',
mediaTypes: {
banner: {
sizes: topsizes
}
},
bids: [{
bidder: 'rubicon',
params: {
accountId : ACCOUNTID,
siteId : SITEID,
zoneId : ZONEID,
position : 'atf',
keywords : [],
inventory : {
category : ['Culture'],
}
}
}]
}]
const customConfigObject = {
"buckets": [
{
"precision": 2,
"max": 1,
"increment": 0.01
},
{
"max": 3,
"increment": 0.10
},
{
"max": 10,
"increment": 0.5
},
{
"max": 40,
"increment": 1.00
}
]
}; var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.setConfig({
rubicon: {singleRequest: true},
sizeConfig: [{
'mediaQuery': '(min-width: 1280px)',
'sizesSupported': [
[970,250],
[728,90],
[160,600],
[300,600],
[300,250],
[1,1]
],
'labels': ['desktop']
}, {
'mediaQuery': '(min-width: 1200px)',
'sizesSupported': [
[970,250],
[728,90],
[300,250],
[160,600],
[1,1]
],
'labels': ['desktop-small']
}, {
'mediaQuery': '(min-width: 1024px) and (max-width: 1279px)',
'sizesSupported': [
[728,90],
[300,250],
[1,1]
],
'labels': ['tablet']
}, {
'mediaQuery': '(min-width: 0px) and (max-width: 1024px)',
'sizesSupported': [
[300,250],
[320,100],
[320,50],
[1,1]
],
'labels': ['phone']
}
],
})});
pbjs.que.push(function() {
pbjs.setConfig({
consentManagement: {
gdpr: {
timeout: 8000 // GDPR timeout 8000ms
},
},
priceGranularity: customConfigObject,
});
pbjs.addAdUnits(adUnits);
});
/** Executes a parallel auction with prebid **/
function executeParallelAuctionAlongsidePrebid() {
var FAILSAFE_TIMEOUT = 3000;
var requestManager = {
adserverRequestSent: false,
aps: false,
prebid: false
};
// when both APS and Prebid have returned, initiate ad request
function biddersBack() {
if (requestManager.aps && requestManager.prebid) {
sendAdserverRequest();
}
return;
}
// sends adserver request
function sendAdserverRequest() {
if (requestManager.adserverRequestSent === true) {
return;
}
requestManager.adserverRequestSent = true;
window.__tcfapi("addEventListener", 2, function(tcData, success) {
if ( ! tcData.gdprApplies ) {
if(!window._initAds) {
window._initAds = true;
googletag.cmd.push(function() {
googletag.pubads().refresh();
});
}
}
if (success && ( tcData.purpose.consents[1] || tcData.eventStatus === "useractioncomplete")) {
if(!window._initAds) {
window._initAds = true;
googletag.cmd.push(function() {
googletag.pubads().refresh();
});
}
}
});
}
// sends bid request to APS and Prebid
function requestHeaderBids() {
googletag.cmd.push(function() {
// APS request
apstag.fetchBids({
timeout: 3000
}, function(bids) {
apstag.setDisplayBids();
requestManager.aps = true; // signals that APS request has completed
biddersBack(); // checks whether both APS and Prebid have returned
});
}
);
// put prebid request here
pbjs.que.push(function() {
pbjs.requestBids({
bidsBackHandler: function() {
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync();
requestManager.prebid = true; // signals that Prebid request has completed
biddersBack(); // checks whether both APS and Prebid have returned
})
}
});
});
} // initiate bid request
requestHeaderBids();
// set failsafe timeout
window.setTimeout(function() {
sendAdserverRequest();
}, FAILSAFE_TIMEOUT);
};
executeParallelAuctionAlongsidePrebid();
我已经尝试通过所有文档来寻找答案,但我什么也没想到。当我在我的网站上运行 pbjs_debug 时,没有控制台错误,拍卖正常运行,但从来没有为那些没有其他东西可以填补空缺的出价触发“出价中标”。
不确定我是否在这里遗漏了一些非常明显的东西。
我使用 GAM 作为广告服务器,并且所有订单项都根据投标前文档进行设置。
我的价格配置可能有问题吗?还是 UAM 设置完全错误?
我确实在此设置了 gpt 延迟加载,之前我认为这可能会导致问题,但即使使用延迟加载并且删除它似乎不起作用,我仍然会产生收入。
任何想法都会很有帮助!