Notification texts go here Contact Us Buy Now!

How to use Lazyload Adsense?

Improve your Site Performance by lazyloading your Adsense Scripts.

The posts are updated based on the Latest Template, please follow the steps if you are using version 2.6.1

Table of Contents
Lazyload Adsense Scripts
Lazyload Adsense Scripts

Lazyload Adsense helps to improve your Site Performence and its loading time. If you want to lazyload your adsense scripts, here are few steps you have to follow.

You should not use lazyload adsense, while it is under review, you must add the adsense scripts in head section at that time. It is recommended to use lazyload adsense when Adsense has approved your domain, and Ads are ready to show on your domain.

* Follow the steps while your site is under review:

Find the following codes:

<!--[ Defer Adsense script use shinsenter/defer.js ]-->
<!--<script type='deferjs' src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0000000000000000' crossorigin='anonymous'/>-->

Uncomment the codes and replace the marked parts with your Publisher ID. It will look like:

<!--[ Defer Adsense script use shinsenter/defer.js ]-->
<script type='deferjs' src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0123456789012345' crossorigin='anonymous'/>

Using Lazyload Adsense

* Follow these simple steps to use Lazyload Adsense:

Find the following codes:

adsenseAds: {
  publisherId: caPubAdsense.replace('ca-pub-',''), /* Auto or replace with Publisher ID i.e. "000000000000", */
  antiAdBClose: "true", /* "true", if you want to add a Close Button in Anti Ad Block popup */
  ignoreMaxAge: "86400",
  loadType: "defer" /* lazy, defer, scroll */
}

If your blog is connected with your Adsense, then no need to replace the marked caPubAdsense.replace('ca-pub-','') otherwise you have to replace it with your Adsense Publisher ID. For eg. replace caPubAdsense.replace('ca-pub-','') with 0123456789012345.

Set the script loading type. For eg. lazy, defer or scroll.

While adding Ad Units, add the marked parts only:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0123456789012345"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-0123456789012345"
     data-ad-slot="7060116223"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

About the Author

~ Hello World!

4 comments

  1. My blog is connected with my AdSense account; and I'm using auto ads from AdSense; What is the solution for auto ads? My website speed goes down after I'm getting AdSense approval.
  2. thanks you sir it really help my site to speed up.🙏
  3. Adsense Give
    script async='async' crossorigin='anonymous' src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0123456789012345'

    vs
    And you provided
    script type='deferjs' src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0123456789012345' crossorigin='anonymous'

    Is there an error here?
    1. Second one uses Defer js to make script load after page loads.
🌟 Attention, Valued Community Members! 🌟

We're delighted to have you engage in our vibrant discussions. To ensure a respectful and inclusive environment for everyone, we kindly request your cooperation with the following guidelines:

1. Respect Privacy: Please refrain from sharing sensitive or private information in your comments.

2. Spread Positivity: We uphold a zero-tolerance policy towards hate speech or abusive language. Let's keep our conversations respectful and friendly.

3. Language of Choice: Feel free to express yourself in either English or Hindi. These two languages will help us maintain clear and coherent discussions.

4. Respect Diversity: To foster an inclusive atmosphere, we kindly request that you avoid discussing religious matters in your comments.

Remember, your contributions are valued, and we appreciate your commitment to making our community a welcoming place for everyone. Let's continue to learn and grow together through constructive and respectful discussions.

Thank you for being a part of our vibrant community! 🌟
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.