What is Adsense lazy load? Lazy loading Google Adsense is a method in which Adsense ads are loaded only after the user sees them. This solves the first and foremost problem with Google Adsense: Its very slow loading speed. Although on the downside, if your ad is not loaded, technically it has not received an impression.
See Also: Our plugin to manage Adsense in WordPress
Google Adsense is the main and most trusted ads program in the world. It helps you easily monetize your website and blog, regardless of its size, rank, or audience. It also tailor makes the ads through Google’s powerful algorithms, offering each user unique and useful products.
On the flip side, Google Adsense slows pages down. A test run by Diana Jensen of the WPBloggingNerd showed that by adding 3 Adsense banners, loading time is increased by up to 34%, the page size by 200%, and the number of requests by 400%. So in a paradoxical way, your monetization tool is also chasing your customers out of the door.
Advertising management is a critical action on your site and it directly affects how much you earn from your site or lose!
Why Lazy Load Google Adsense
Lazy loading is a popular web design pattern. It essentially loads an object (the ad in this case) when the user gets to it by scrolling the page. So your page will stop loading after important and above-the-fold elements are finished. If the user wants to navigate more, new objects will load in real-time.
By lazy loading Google Adsense, you will take some pressure off the initial loading process. making it easier for the page to load and for users to have a quick look at the site, and take actions according to what they see. Maybe they want to click on the navigation bar. Why load the footer ad for them anyway?
How to Lazy Load Adsense on WordPress
We will offer 2 ways to lazy load Google Adsense. One is to simply use the Better Ads Manager plugin (comes alone and with Publisher theme as an extra). The second one is to add it yourself.
The Easy Way: Install Better Ads Manager
Better Ads Manager is one of the most popular WordPress ads plugins and with 120+ ad locations, Adsense Compatibility, Adblocker detector, and AMP support have the features to match its reputation.
The most recent update of Better Ads Manager comes with lazy loading Google Adsense as a default. You can enable it easily through the plugin’s options. To enable lazy loading for Adsense take the following steps:
- In WordPress admin panel, open Better Ads options.
- Open Ads Manager
- Click on Lazy Loading Ads (picture above)
- Set Lazy Load Ads? to Yes, Lazy load all Ads
That’s it!
The Hard Way: Implement Javascript
The Javascript root is a bit tougher. So if you’re not sure, leave it to an expert to do it for you. This method is courtesy of Gulshan Kumar and should work fine.
With every ad unit, comes an add code. It all includes the js code below:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Remove the code above from all ad units.
then add the code below to your site’s footer:
<!--noptimize-->
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
<!--/noptimize-->
4 Comments Leave a Reply
Great Finally I found very useful script and trick to increase page speed. Thanks a lot. By using your method I made a small script for custom website or for blogger platform website. Also Like you I shared on my website also Technical Arp Please check if you can.
Again Thanks for small but very useful method.
This method is actually defer loading for a better performance betterstudio team must consider using LazyHTML
https://github.com/Niresh12495/LazyHTML
Thank you for letting us know, we’ll look into it ASAP.
Great!
Thanks for share it.