Load GPT and bids in parallel
Stay organized with collections
Save and categorize content based on your preferences.
Overview
This audit checks whether or not header bidding requests are deferred until the
Google Publisher Tag (GPT) library loads. In most cases, these requests are not
dependent on GPT and can be made in parallel with the library being loaded to
speed up ad loading.
Recommendations
Ensure that header bidding requests do not wait on googletag.pubadsReady()
or
googletag.cmd.push()
.
Prebid.js Example
Incorrect |
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
});
});
});
|
Correct |
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();
});
|
The list of supported ad exchanges and supply side platforms this audit
evaluates can be found in
our GitHub repository.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 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."]]],[]]