טעינת GPT והצעות מחיר במקביל
סקירה כללית
הביקורת הזו בודקת אם בקשות לבידינג בכותרת מושהות עד שספריית Google Publisher Tag (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.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-10-16 (שעון UTC).
[null,null,["עדכון אחרון: 2024-10-16 (שעון UTC)."],[[["This audit checks if header bidding requests are delayed until the Google Publisher Tag library loads, potentially slowing down ad loading."],["It's recommended to make header bidding requests independent of GPT loading to improve performance."],["You can make your header bidding requests independent of GPT by ensuring they don't wait for `googletag.pubadsReady()` or `googletag.cmd.push()`, as demonstrated in the Prebid.js example."],["A list of supported ad platforms evaluated by this audit is available on the project's GitHub repository."]]],["The audit checks if header bidding requests are unnecessarily delayed by waiting for the Google Publisher Tag (GPT) library to load. Header bidding requests should be independent of GPT to speed up ad loading. Avoid using `googletag.pubadsReady()` or `googletag.cmd.push()` to trigger bid requests. The correct approach, exemplified with Prebid.js, is to initiate `pbjs.requestBids` outside of the `googletag.cmd.push()` function, making the bid requests run in parallel to GPT loading.\n"]]