Speed ​​Up Blog Loading with Lazy Load AdSense

Speed ​​Up Blog Loading with Lazy Load AdSense
Vikelsik
Vikelsik •
Table of Contents
For those of you who use your blog as a source of income, you're certainly familiar with Google AdSense . Yes, Google AdSense is a Google product that's one of the reasons publishers want to further develop their sites. Although not all have the same reasons.


On the other hand, AdSense is one of the contributors to loading because the ads displayed by JS AdSense will reduce the loading speed of our blog even though JS AdSense already uses asynchronous, but it will still make the blog wait longer to load.

Here I will give an example of a comparison image before and after using this Lazy Load AdSense trick .

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

Speed Up Blog Loading with Lazy Load AdSense


This code works quite simply: ads will appear after scrolling down the page. Therefore, the AdSense JS won't appear until you scroll down the page.

This tip is intended for those of you who have already installed AdSense on your blog. For those who haven't, the code I'm about to share can be used for other purposes, such as loading external JS links.

Open 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 you haven't already, be sure to remove all AdSense JS links typically embedded in the AdSense ad unit code. Like this:

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

This code can also be combined with the JS Adblock Killer link I shared in the post " How to Install the Latest Version of Adblock Killer ." Those of you who have already tried that 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 you're done.

Maybe you are asking, is this code safe for our AdSense?

The answer is, of course, safe. Google also recommends speeding up blog loading times, such as installing Lazy Load Image code to speed up image loading on site pages.

And will it affect our blog's AdSense income?

I don't know about this one yet, as I just installed it myself. We'll just have to wait and see how it goes. If our income decreases, it might just not be our destiny. 😊 Hehe... The solution, my friend, is to revoke the code and restore it to its original state.

In conclusion, prioritize what you think you need. If you want your blog to grow faster, you can try the trick above. However, if you're still unsure about the potential decrease in AdSense revenue, you can simply abandon the idea. However, for me, I consider this a new experience; what I value here is the progress: "Will installing this code affect AdSense?" Well, that curiosity is what makes me more enthusiastic, even though there are risks involved. 😃

Okay, that's enough for the post on Speeding Up Blog Loading with AdSense Lazy Load , I hope it's useful for all of you and wassalam.  
Vikelsik
Vikelsik Just to share tricks & tips + interesting information that is useful for the whole world and outer space. Enjoy!

Post a Comment