Updates:
WELCOME TO LANTRO UI • A BOLD BLOGGER THEME WITH NEUBRUTALISM • FAST, LIGHTWEIGHT, AND FULLY CUSTOMIZABLE • STAY TUNED FOR MORE UPDATES •THEME SWITCHING IS NOW AUTO, TRY NOW BY CHANGING YOUR SYSTEM THEME
Welcome to Lantro UI v1.7! Get now!

Add AdSense Script In Lantro UI v1.7 Without Effecting Page Speed

Thumb

We recommend that you use this feature after AdSense approval. During AdSense review, the original script is the best option.

Google AdSense help you earn through your website, which was a good motivation to continue your website, but also the Google AdSense ad implementation script reduces the page speed,p if you are using Lantro UI v1.7, then don't worry about it, we have implemented lazy.js made by www.fineshopdesign.com. Which helps with lazy loading JS using local storage.

How To Enable lazy.js AdSense Script?

In the Lantro UI v1.7 theme, you just need to enable lazy.js based AdSense script, to enable it find the following code in the theme HTML:

<!-- <script>/*<![CDATA[*/lazy.then(function(){var s=document.createElement("script");s.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-your_publisher_id_here";s.async=!0;s.crossOrigin="anonymous";document.head.appendChild(s)})/*]]>*/</script> -->

Replace it with:

<script>/*<![CDATA[*/lazy.then(function(){var s=document.createElement("script");s.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-your_publisher_id_here";s.async=!0;s.crossOrigin="anonymous";document.head.appendChild(s)})/*]]>*/</script>

Don't forget to replace your_publisher_id_here  with your AdSense Publisher id

When you add ads manually always avoid script on the top of manual ad code

Example
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-000000000000000"
     crossorigin="anonymous"></script>
<!-- Ads -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-00000000000000"
     data-ad-slot="0000000"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- Ads -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-00000000000000"
     data-ad-slot="0000000"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

Reference:
www.fineshopdesign.com

A student, web developer, and content creator passionate about exploring technologies and sharing insights while balancing studies and interests.

Post a Comment

Don't put spam comments in the comment box. All comments are reviewed by the admin.