Загружать 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 .
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2024-11-12 UTC.
[null,null,["Последнее обновление: 2024-11-12 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"]]