סקירה
הביקורת הזו בודקת אם בקשות לבידינג ב-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 אפשר למצוא את רשימת הבורסות הנתמכות והפלטפורמות לאספקת הנתונים שהבדיקה נבדקת.