Speed ​​up Loading Website with AdSense Lazy Load

XpertShout

Read Also

Speed ​​up Loading Website with AdSense Lazy Load
Speed up your blog with lazy load even with google adsense ads. Many bloggers are using google adsense to earn money from their websites. For this purpose, they need to use adsense ads script on their websites.

Speed ​​up Loading Website with AdSense Lazy Load

These script cause websites for slow loading. But don't worry, XpertShout sharing a solution for speed up loading website.

How Speed Up Loading Code works?

How this code works? when we add this code on our website or blog. your website will load speedy but ads will not shown until you scroll the page. It means adsense script will not work until you scroll the page.

Speed ​​up Loading Website with AdSense

Now follow the below steps as i have written below to add speed up loading website script on your website.
These tips are intended for friends who have installed AdSense on their blog. For those who haven't, the code that I will share can be used for other needs such as loading an external JS link.
  • Open Blogger
  • Click on Themes menu.
  • Click on edit html.
  • Add the code below before </body>.
<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>

Above script includes adsense js script. So, make sure delete all adsense js links from website like this.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

If you are using other than adsense ads. You can use those js link in lazy load script instead of Adsense Js script.

Will it affect the AdSense Revenue of Our Website or Blog?

I don't know. Because still i am not using any publisher ads. But i have installed this script on my blog.

Load comments

No comments