How To Speed Up Website Loading with Adsense Enabled

Website speed depends on many aspects from back end and front end part. If you have enable ads in your site, it will affect your website loading speed. In this blog, I will discuss how to speed up website loading with Adsense enabled. Even Adsense use asynchronous loading to prevent blocking render when loading Adsense library, in fact it takes sometimes and affect user experience when visiting our website.

One of hack we can use is using lazyload method. We will load Adsense JS library in onscroll function. Change this short line that provide by Google and replace it with following modification code.

<script async src="//"></script>

Replace it with:

<script type='text/javascript'>//<![CDATA[// Lazy Load AdSensevar lazyadsense=!1;window.addEventListener("scroll",function(){(0!=document.documentElement.scrollTop&&!1===lazyadsense||0!=document.body.scrollTop&&!1===lazyadsense)&&(!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src="";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyadsense=!0)},!0);//]]></script>

Place your ads, in bottom of your content, so when user load your page, and scroll page, it will load Adsense JS library, and your ads will be showed.

Originally posted 2019-03-06 11:16:56.

See also  How to backup Ghost blog

About wahyuway

Check Also

Best Server Management Control Panel

In recent years, cloud technology has been more advance, their platforms, security aspects, scaling, соmрutіng …

Leave a Reply