Forum Moderators: martinibuster
[edited by: martinibuster at 6:43 pm (utc) on Feb 8, 2021]
Is there any possible ways to lazyload adsense?
Is there any consequence by lazyloading adsense?
This doesn’t work properly, it loads ads in wrong order
This not lazyloading, This is defer loading.
(adsbygoogle = window.adsbygoogle || []).push({}); setTimeout(function(){(adsbygoogle = window.adsbygoogle || []).push({})}, 1000); (Error: No slot size for availableWidth=0)
data-full-width-responsive="true" The problem is that delaying the script execution of an above the fold ad can be problematic, as the ad code will be executed but due to the delayed loading the ad may never be seen as the user will scroll past it.
[edited by: martinibuster at 11:19 am (utc) on Mar 14, 2021]
[edit reason] Pls don't make people read an entire web page. Just describe the code. Thx [/edit]
I'll be posting Git Project here, When I'm done with Git.
[edited by: martinibuster at 11:21 am (utc) on Mar 14, 2021]
[edit reason] Link isn't necessary to this discussion. [/edit]
<div id="div-2" class="ad-slot" style="height: 90px; width: 728px;">
<script> googletag.cmd.push(function() { googletag.display('div-2'); }); </script> </div>. [edited by: martinibuster at 8:17 am (utc) on Mar 3, 2021]
[edit reason] Removed AS code. [/edit]
Lazy loading the ads might violate the terms and conditions where it's against the rules to change how the ads are delivered. The ads are delivered asynchronously. Lazy loading the div element that contains the ad may change how those ads are loading, imo.