Performance blogs or websites will eventually drop when advertised by third parties such as ads on Google Adsense and other digital advertising. To avoid that, a special method is needed to load ads so that loading or website performance is maintained.
Generally the method used to load ads so as not to affect the performance of the website/blog is to apply lazy load to fish (adsense), therefore here I will give a fairly complete review of lazy load adsense.
You can solved the LCP Issue/ problem on core web vitals due to google adsense ads with Lazy Load Adsense.
Without Lazy Load Adsense your LCP can be poor or higher than 4s. The best LCP is lower than 2,5 s.
What is Lazy Load Adsense?
Why Should You Use Lazy Load Adsense?
- Third party webfont load
- JavaScript execution time
- Main-thread work
- Impact of third party code, etc
Instructions for Using Lazy Load Adsense
<script async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"/>
//or a new version of the javascript library
<script async="async" data-ad-client="ca-pub-1234567890123456" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"/>
//or updated version
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4209467777280582" crossorigin="anonymous"></script>
To :
<script type="text/javascript">//<![CDATA[
var lazyloadads=false;window.addEventListener("scroll",function(){(0!=document.documentElement.scrollTop&&false===lazyloadads||0!=document.body.scrollTop&&false===lazyloadads)&&(!function(){var e=document.createElement("script");e.type="text/javascript",e.async=true,e.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-420946777728xxxx";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyloadads=true)},true);
//]]></script>
How the Lazy Load Adsense Script Works ?
Lazy Load Adsense From Adsense Policy Side
For detail step by step yo can watch this video below.