Tech Latest News $type=slider$snippet=hide$author=hide$count=3$show=home

Blogger Tricks $type=sticky$snippet=hide$author=hide$count=4$show=home

Speed up blog loading with AdSense lazy loads || How to Setup Lazy Load for Google AdSense Ad units || Lazy Load Setup for Google AdSense Ad units

Google AdSense is a monetization program executed by Google. This remains the most reliable way for many publishers to earn money...



Google AdSense is a monetization program executed by Google. This remains the most reliable way for many publishers to earn money online. One common problem faced by publishers is that Google AdSense affects the speed of our original blog. Because we have no control to customize resources, we feel unhappy.


Like YouTube video thumbnails, they should use WebP for ad unit images. It is ironic that sometimes they are not bothered to serve with GZIP compression, or do not minimize resources. Massive resources and additional burden of many DNS searches kill the speed of our page like hell.

A few months ago, when I tweeted the speed of the ad unit, I could not find a satisfactory answer. I came back with a solution that would prevent AdSense from slowing down its original content load.

Honestly, personally I am not a big fan of lazy cargo, even for images. But still, I just want to share an option. If you wish, you can try it once, if you are very concerned about the primary content service instead of the ad units.



Instruction for Setup Lazy Loading for AdSense
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- leaderboard -->
<ins class="adsbygoogle"
 style="display:inline-block;width:728px;height:90px"
 data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
 data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Technical details :

Basically, what happens when it is loaded asynchronously means that the browser continues to download adsbygoogle.js scripts without blocking the HTML analysis.

But here, in the slow loading method, I will convert the ASYNC method to the real DEFER. Once the main web page has finished loading, the AdSense script will start downloading into the browser. In this way, the visitor will not have to wait for Adsense to quickly see the entire page.

For this purpose, you do not have to make major changes to your ad unit. We will simply change the loading style of adsbygoogle.js that will do all the magic.

All you need to follow below two Steps


  • First of all, remove below script from all ad units.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>


  • After then, add below JavaScript code in your Theme Footer, possibly just before the </body> tag
<!--noptimize-->
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
<!--/noptimize-->


Name

Adsense,1,Blogger Tricks,7,companies,2,Earn Money Online,6,Firstpost Tech Latest News,1550,Gogi Tech,6,Teck Trick,10,Web Tools,1,
ltr
item
Technical Guru | Technical Tricks | Letest Technical Tricks: Speed up blog loading with AdSense lazy loads || How to Setup Lazy Load for Google AdSense Ad units || Lazy Load Setup for Google AdSense Ad units
Speed up blog loading with AdSense lazy loads || How to Setup Lazy Load for Google AdSense Ad units || Lazy Load Setup for Google AdSense Ad units
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTEjk1cnBv2oMuivxYo6ja3VCYwijxZr0MFw7MeNJxdwjjAt3qteBGPByLMJrVc_n_wMY7iaIU5a68mr8IegqAHQ6h1E6Coe-96ePu5ZIl1xPyxIZlYPd7yM09hpjdlQj1DAVu8O3E-iQ/s640/44r.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTEjk1cnBv2oMuivxYo6ja3VCYwijxZr0MFw7MeNJxdwjjAt3qteBGPByLMJrVc_n_wMY7iaIU5a68mr8IegqAHQ6h1E6Coe-96ePu5ZIl1xPyxIZlYPd7yM09hpjdlQj1DAVu8O3E-iQ/s72-c/44r.jpg
Technical Guru | Technical Tricks | Letest Technical Tricks
http://technicalguru.rclipse.com/2019/01/speed-up-blog-loading-with-adsense-lazy.html
http://technicalguru.rclipse.com/
http://technicalguru.rclipse.com/
http://technicalguru.rclipse.com/2019/01/speed-up-blog-loading-with-adsense-lazy.html
true
4056116136589420091
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy