I am using GAM as so:

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {

        googletag.defineSlot('/86406173/ArticleLeaderboard', leader_size, 'div-gpt-ad-1321481451196-0').addService(googletag.pubads());
        // etc.

            fetchMarginPercent: 200,
            renderMarginPercent: 100,
            mobileScaling: 2.0


Is there a conflict of interest between enableLazyLoad() and enableSingleRequest()?


any reason why googletag.pubads().enableLazyLoad() is repeated twice in your code ?

commented: Thanks for the bug catch! +34

I also want to mention that since enabling it, my % viewable has increased by about 15% with no changes to ad placement.

I have a question though : how do you check enableLazyLoad works as expected ?
While I noticed a better page performance using https://developers.google.com/publisher-ads-audits/ I can't seem to find an easy option to verify ads, placed at the bottom of a page, are not loading until user scrolls down.
Thank you

So what I did to test was I opened a page of my site with an ad at the bottom using Chrome. I then right clicked and selected Inspect to open the Developer Tools and I went to the Elements tab. I searched for where in the DOM the ad would be, and I found the code:

<div id="div-gpt-ad-1321481451196-0">
    googletag.cmd.push(function() { googletag.display('div-gpt-ad-1321481451196-0'); });
    <div id="google_ads_iframe_/86406173/ArticleLeaderboard_0__container__" style="border: 0pt none; width: 728px; height: 90px;"></div>

You can see it looks just like the way it was initially copied/pasted from GAM, but with the following empty <div> was added:

<div id="google_ads_iframe_/86406173/ArticleLeaderboard_0__container__" style="border: 0pt none; width: 728px; height: 90px;"></div>

Then, I slowly scrolled down the page while keeping an eye out on that particular line. After about scrolling halfway down the page, that line morphed into:

<div id="div-gpt-ad-1321481451196-0" data-google-query-id="CPrnqODByukCFcYXrQYdZ0YOTA">
    <div id="google_ads_iframe_/86406173/ArticleLeaderboard_0__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/86406173/ArticleLeaderboard_0" title="3rd party ad content" name="google_ads_iframe_/86406173/ArticleLeaderboard_0" width="728" height="90" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" srcdoc="" data-google-container-id="2" style="border: 0px; vertical-align: bottom;" data-load-complete="true"></iframe></div>

I'm just giving you the summary because the <iframe> was now populated with the full third-party ad copy.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.