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