How to Install Lazy Load Adsense
![]() |
| Ads Lazy Loading |
AdSense is an advertising collaboration program via the internet launched by Google. Through the Google Adsense program, members who have been approved for membership may place fish units on a personal website or blog.
The system is profit sharing with pay per click (ppc) income or pay per click. For those who have passed to become a member of Google Adsense, surely the web will be a little slow. This is because the default script is quite heavy.
The optimization method is to use the lazy load Adsense technique . Relax, here the admin will share how to install the new Google Adsense lazy load script code.
What is Lazy Load Google Adsense?
Lazy load adsense is a smart loading script that temporarily delays the loading of third party code. This method displays necessary ads when the user starts scrolling through the web page. Thus, it can reduce latency, CPU consumption, and maintain website performance.
Is Lazy Load Safe for Blogs?
Many questions arise about security if you have lazy load installed . The answer is safe, Google is also open in implementing this technique. The admin has also installed it since the beginning it was accepted by Adsense and there were no problems at all.
How to Install Google Adsense Lazy Load to Speed Up Blog Loading
As time goes by, at this time there are a lot of scripts that are useful for our blog if we install them. One of them is the lazy load google adsense script .
The working principle of the google adsense lazy load script is to optimize the google adsense java script script, so that loading is fast and does not burden the blog. Then how do you install lazy load google adsense? It's quite easy to install. Straight to,
1. open your blog dashboard .
2. Enter the theme , then click Edit HTML .
3. Search for the code <script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>, then remove the code from the template. If more than 1 is found, then delete all of them. Usually the amount of code is the same as the number of ads that you post.
4. After that look for the code </body>or <!--</body>--></body> then put the following code right above it.
<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>
5. Save it!
Lazy Load Ad Script In Various Versions
Manual Script Writing (Basic Script)
Lazy Load Adsense With Scroll
<script> //<![CDATA[
/* Lazy Load Ads on Scroll by igniel.com */
let lzAd = false;
window.addEventListener('scroll', () => {
(0 != document.documentElement.scrollTop && false === lzAd || 0 != document.body.scrollTop && !1 === lzAd) && (!function(){
Insert Your Basic Script Here
}(), lzAd = true);
}, true);
//]]> </script>
Lazy Load Adsense With Timer
<script> //<![CDATA[
/* Lazy Load Ads with Timer by igniel.com */
let lzAdTime = 6;
setTimeout(() => {
Insert Your Basic Script Here
}, lzAdTime * 1000);
//]]> </script>
that's how to install lazy load adsense,that's all I can say in this article.
https://www.igniel.com
.png)
.jpeg)