2
我是新來的標題出價。 我使用預先標題出價創建了廣告位。我已經提到了下面的代碼。我需要知道這是使用標題出價工作的正確方法。 讓我知道是否有更改要在服務器中進行託管。標題出價 - Prebid.js
Prebid.js
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
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>
<script>
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/xxx/test.maalaimalar', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());
googletag.defineSlot('/xxx/test.maalaimalar', [[728, 90], [970, 90]], 'div-gpt-ad-1460505661639-0').addService(googletag.pubads());
googletag.defineSlot('/xxxx/prebidtest', [[970, 90], [970, 250], [300, 250], [728, 90], [160, 600], [300, 600], [1, 1]], 'div-gpt-ad-1503040981222-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
<h5>Div-2</h5>
<div id='div-gpt-ad-1460505661639-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505661639-0'); });
</script>
</div>
<h5>Div-3(Prebid)</h5>
<div id='div-gpt-ad-1503040981222-0'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1503040981222-0'); });
</script>
</div>
提前
感謝....