Speeding up Blog Loading with Lazy Load AdSense

How to Install Lazy Load for AdSense

For those of you who use the blog as one source of income are already familiar with Google AdSense. Yes, Google AdSense is a Google product that is one reason and the appeal of publishers to further develop their site. Although not all have the same idea.

On the other hand, AdSense is one contributor loadings because the ads that JS display AdSense will lower the loading speed of our blog even though AdSense JS is already using asynchronous, but still, it will make the blog wait longer to be loaded.

Here I will provide examples of comparison pictures before and after using this Lazy Load AdSense trick. Below sample images before using the AdSense Lazy Load trick:

In check using GTmetrix

Loading Cyreug before using the Lazy Load of AdSense

And this uses Google's PageSpeed Insights

Loading Cyreug before using the Lazy Load of AdSense

On checking the Cyreug site at GTmetrix, get a PageSpeed Score of 68% and YSlow Score of 78%. And for PageSpeed Insights get 97 results for Desktop and 90 for Mobile. Less fast. However, after I installed the AdSense Lazy Load code, the result was better than before as in the image below:

In check using GTmetrix

Loading Cyreug after using the Lazy Load of AdSense

And this uses Google's PageSpeed Insights

Loading Cyreug after using the Lazy Load of AdSense

Once installed for PageSpeed Insights get the result 100 for Desktop and 95 for Mobile. Yes, it is still not perfect for Mobile, but there is at least an improvement than before.

Well, for those of you who want to speed up the loading of the blog, please follow these tips.

Speeding up Blog Loading with Lazy Load AdSense

The way this code works is quite simple, i.e., ads will appear after we scroll through the page. So AdSense JS will not appear before we scroll through the site page.

These Tips are intended for you who have already installed AdSense on your blog. For those who have not the code, I will share this can be used for other needs such as loading external JS links.

Go to Blogger > Click the Theme menu > Click the Edit HTML button > Add the code below before </body> or &lt;!--</body>--&gt;&lt;/body &gt;

<script type='text/javascript'>
//<![CDATA[
// Lazy Load AdSense
var 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="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyadsense=!0)},!0);
//]]>
</script>

If not, be sure to remove all the AdSense JS links that are usually attached to the AdSense AD Unit code. Like this:

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

This code also can be combined with the JS Adblock Killer link that I have shared on the How to install Adblock Killer latest version post. For those of you who have done the trick can use this code:

<script type='text/javascript'>
//<![CDATA[
// Lazy Load AdSense
var 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="https://cdn.jsdelivr.net/gh/Arlina-Design/quasar@master/arlinablock.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyadsense=!0)},!0);
//]]>
</script>

Once added, click the Save Theme button and done.

Maybe you ask, is this code safe for our AdSense?

The answer is safe. Because Google also advised accelerating the loading of the blog as well as installing Lazy Load Image code to speed up image loading on the site page.

And would it be influential to our blog's AdSense income?

For this one, I do not know, because I have just installed it before. We just look at the progress. If the revenue is reduced, we might be out of luck. The solution you can revoke the code and restore it as it was again.

In conclusion, prioritize what you think needs. If you want a faster blog to do the trick above, but if you're still unsure about the AdSense revenue (which will probably) decline, you just undo the intention to install it. But for me, this thing I consider being a new experience, which I value here is the Progress  "is by installing this code will affect AdSense?" Well, that's the curiosity that makes me more excited despite the risk of having to Accepted. 😀

Okay, I'm good enough to post Speeding up Blog Loading with Lazy Load AdSense, hopefully, useful for you, and thanks.

0 Comments

Post a Comment