同時載入 GPT 和出價

總覽

這項稽核會檢查標頭出價請求是否延遲到 Google 發布商廣告代碼 (GPT) 程式庫載入為止。在大多數情況下,這些要求不需要依賴 GPT,而且可以和載入的程式庫同時發出,以加快廣告的載入速度。

建議

確保標頭出價請求不會等待 googletag.pubadsReady()googletag.cmd.push()

Prebid.js 範例

錯誤
window.pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

window.googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
  googletag.pubads().disableInitialLoad();
  // Incorrect: Making bid requests dependent on GPT loading.
  pbjs.que.push(function() {
    pbjs.requestBids({
     bidsBackHandler: handleBidResponse
    });
  });
});
正確
window.pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
// Correct: Making bid requests independent of GPT loading.
pbjs.que.push(function() {
  pbjs.requestBids({
    bidsBackHandler: handleBidResponse
  });
});

window.googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
  googletag.pubads().disableInitialLoad();
});

更多資訊

您可以在 GitHub 存放區中找到這項稽核所評估的支援廣告交易平台和供應端平台清單。