טעינת GPT והצעות מחיר במקביל

סקירה כללית

הביקורת הזו בודקת אם בקשות לבידינג ב-header נדחות עד ספריית Google Publisher Tag (GPT) נטענת. ברוב המקרים, הבקשות האלה לא תלויים ב-GPT ואפשר ליצור אותם במקביל כשהספרייה נטענת לזרז את טעינת המודעות.

המלצות

מוודאים שבקשות לבידינג ב-header לא ממתינה ב-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.