Lazy load AdSense ads in blogger to speedup
Here you will know how to enable Lazyload adsense ads in blogger to boost the speed of your site to get more visitors so that, you can earn more.
Go To Blogger Dashboard and click on Edit HTML then Follow below instruction and paste the codes accordingly:
Remove all codes of adsense in your template then copy paste below code and replace the publisher id with your own publisher id
<script type='text/javascript'> //<![CDATA[ var lazyadsense2 = false; window.addEventListener("scroll", function(){ if ((document.documentElement.scrollTop != 0 && lazyadsense2 === false) || (document.body.scrollTop != 0 && lazyadsense2 === false)) { (function() { var ad = document.createElement('script'); ad.setAttribute('data-ad-client','ca-pub-xxxxxxxxxxxxxxxx'); ad.async = true; ad.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'; var sc = document.getElementsByTagName('script')[0]; sc.parentNode.insertBefore(ad, sc); })(); lazyadsense2 = true; } }, true); //]]> </script>
Now save the changes and you will get the best result onward to speedup your site performance experience to your user.