Google AdSense is a monetization program run by Google. It still the most reliable way to make money online for many publishers. One common problem publishers often face that Google AdSense affect our original blog speed. Due to not have control for optimizing resources, we just end up with feeling sad.
Like YouTube video thumbnail, they should be using WebP for ad units images. It's ironic, that sometimes they do not bother to serve with GZIP compression, or keep resources minified. The massive resources and extra loads of many DNS lookup, kill our page speed like hell.
@AdSense Why so slow?– TheGulshanKumar
A few months ago, when I tweeted Ad unit speed problem, I didn't get any satisfactory response. I am back myself with a solution that will prevent AdSense from slowing down loading of your original content.
Honestly, I am not personally a huge fan of the lazy load even for images. But still, I just want to share an option. If you like, you may try once if you are highly concerned with serving primary content first, before Ad Units.
Instruction for Setup Lazy Loading for AdSense
Have a look how original ad unit code look.
Technical details: Basically what happens that it load in asynchronous form, means browser continue downloading adsbygoogle.js script without blocking the HTML parsing.
But here, in the lazy loading method I am going to change the ASYNC method to real DEFER. The AdSense script will start downloading in browser, once window will complete loading the main web page. In this way, visitor don't have to wait for seeing whole page quickly for the AdSense.
For this purpose, you don't need to make any big changes in your ad unit. Simply we will alter the style of loading adsbygoogle.js that will do all the magic.
All you need to follow below two Steps
- First of all, remove below script from all ad units.