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 ran by Diana Jensen of the WPBloggingNerd showed that by adding 3 Adsense banners, page speed 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.
Why use lazy loading for 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 of 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 can I lazy load Google Adsense on WordPress
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 has 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
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: