Notifikasi
Notifikasi
Telah rilis pembaruan template Gila Material Pro v1.3. Ada diskon hingga 15% untuk periode 15 - 18 November 2022. KLIK DISINI
Find job vacancies

How to Setup Lazy Load for Google AdSense Ad units on Blogger


Google AdSense is a monetization program run by Google. It still the most reliable way to make money online for many publishers. One common problem publishers often face that Google AdSense affect our original blog speed. Due to not have control for optimizing resources, we just end up with feeling sad.
How to Setup Lazy Load for Google AdSense Ad units on Blogger


Instruction for Setup Lazy Loading for AdSense

  • 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
<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>

NOTE: Noptimize tag is to make compatible with Autoptimize plugin. It will prevent aggregating AdSense lazy loader inline JS.

Honestly, I am not personally a huge fan of the lazy load even for images. But still, I just want to share an option. If you like, you may try once if you are highly concerned with serving primary content first, before Ad Units.
Caution - In the recruitment process, legitimate companies never charge a fee from candidates. If there are companies that charge for interviews, tests, ticket reservations, etc., it is better to avoid them because there are indications of fraud. Do not transfer any payments when applying for a job.
Join the conversation
Post a Comment
Link copied to clipboard