Do you know how to get a score above 95 on mobile using Google's PageSpeed metrics? Even with Adsense ads? For many years people often say that it is impossible, but I kind of found the solution to getting a high score on PageSpeed with Adsense.
If you're like me, you have paranoia about the PageSpeed speed metrics and Vitals, you've already been annoyed at never being able to get a score higher than 95 on mobile because of the damn ads from Google Adsense or ADX.
I have tried every caching plugin to achieve a good score, but practically nothing worked. I have tested Hummingbird, PageSpeed Ninja, LiteSpeed, and even some premium plugins, but nothing brought me even close to 80 on mobile due to the ads.
Until one day, with WP-Rocket I discovered a miraculous function that solved all my problems. Look at the results I'm getting thanks to this:
If you don't have Wp-Rocket, you can try to use plugins that perform the same function as Flying Scripts.
How did I get 90 on PageSpeed Mobile?
How did I have the audacity to get that score even with Adsense + ADX stuffed with ads? The answer is simple, I delayed loading the ads until the page became interactive.
I did this using WP-Rocket and the function to defer the execution of JavaScript, but this can probably be done with other plugins as well. I set the javascripts that contain adsbygoogle and gstatic to be deferred as shown in the image below:
This simple function solves a problem that has been irritating me for years. Of course, I also have to analyze the consequences of activating this function, but I personally believe that it is none.
In addition to the ads I also use the Push notifications plugin and some other scripts and plugins that can weigh the site. I still get a high score thanks to my optimizations and the delay in Google's ad.
Do I lose revenue if I delay JS in ads?
I was afraid that delaying these ads might be violating some Adsense rule, but I believe not, as there are premium ad plugins for WordPress that offer LazyLoad.
I also reloaded the pages several times and noticed that the ads always load without any problems. Only on rare occasions did this not happen, but I cannot say whether it is the fault of my browser or the google script and things like that.
In fact, I keep imagining that this actually increases the number of clicks and also the CPC because the ad appears out of nowhere and grabs the attention of the visitor who sometimes goes unnoticed since it is already loaded on the page.
The fact is that by doing A/B tests, I did not notice any drop in my AdSense earnings after I delayed the ad. In fact, the ADX network I use valueimpression does the same thing. Of course, I recommend you test it yourself before drawing any conclusions.
The fact is that it doesn't just affect the PageSpeed score, your site will actually load faster. So think about this alternative and have an increasingly faster website.
Other ways to increase your PageSpeed score
Of course, just delaying ads will not leave your score at the top. You need to optimize the site, avoid unnecessary uploads like fonts and icons. To make my menu beautiful I chose to use emojis and special characters that do not need any external loading.
You need to use good caching plugins with minification of CSS and JS. I also use a free CDN with Cloudflare Cache and host my images and javascript on the Jetpack CDN. Not to mention that my theme, the GeneratePress, is super lightweight.
There are people who have very heavy topics, some manual optimization and removal of vials are necessary to have results like this. Things like Megamenu are unnecessary and only serve to weigh the site. Remember 80% of visits are mobile so it doesn't matter if your Desktop version has more stuff.
We always recommend checking your site using web.dev instead of only using Google PageSpeed, because it provides some interesting insights. There is a Google Chrome extension for web.dev and vitals that specifically and in detail points out the issues that are hindering the loading of your page.
I hope you don't give up on getting the perfect score, it can be hard work, but it is a great satisfaction! If you liked the tips in this article, share it with friends and leave comments. What did you do to optimize your website?