What is the use of “enableSingleRequest” on websites?
Table of Contents
The enableSingleRequest()
the method is used in Google Publisher Tag (GPT) to optimize how ad requests are sent to Google’s ad servers. It’s especially important for websites using Google Ad Manager (GAM) to serve multiple ad slots on a single page.
What does enableSingleRequest()
do?
By default, GPT might send separate HTTP requests to Google’s ad server for each ad slot on a page. This can cause:
- More network latency
- Slower page loads
- Higher load on browsers (especially on mobile)
When you use:
googletag.pubads().enableSingleRequest();
It bundles all ad slot requests into a single HTTP request, reducing network traffic and improving performance.
Benefits of enableSingleRequest()
- Performance Boost
- Fewer HTTP requests = faster ad fetching = faster page rendering.
- Better Header Bidding Compatibility
- Works better with Prebid.js and other header bidding setups.
- Improved Ad Targeting
- All slots get requested together, so targeting parameters (like keywords or custom targeting) can be consistently applied.
- Higher Fill Rates
- Some advertisers prefer seeing all available slots and bidding accordingly.
Common Use Example
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<script>
window.googletag = window.googletag || { cmd: [] };
googletag.cmd.push(function() {
googletag.pubads().enableSingleRequest(); // Enable single request mode
googletag.enableServices();
});
</script>
⚠️ When Not to Use It?
- If you want lazy loading of ads as the user scrolls.
- If you use different targeting or behaviors per ad slot, and want more granular control.
But for most publishers, enableSingleRequest()
is highly recommended for better efficiency and revenue optimization.