Archived topic
Web performance decrease when Google Adsense code is added
2 replies · Started by Daniel Fernández Sánchez on January 14, 2021
Hello, when I install Google Adsense code in a wp-head hook or in the header.php itself, without even activating the ads, the performance of my website drops considerably due to an excess of javascript code. Is there any way to avoid this, since the website goes from a score of 100 on a cell phone to scores that vary between 50 and 80.
As you indicate, all the plugins, I have, have been deactivated, including one cache plugin, so the origin of the problem should not be in the other plugins. The website that I use for the tests is ratiostellar.com
The code that I have inserted is this:
<script data-ad-client="ca-pub-blablabla" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
I hope you help me as much as you can, thanks.
Performance testing is done from https://developers.google.com/speed/pagespeed/insights/?hl=es&url=https%3A%2F%2Fratiostellar.com%2F
Hi there,
If you need to use the ad then I don't believe so.
The theme itself cannot do anything to improve the performance of third party scripts like Google ads.
You could try if using Autopimize would help a bit?
https://docs.generatepress.com/article/configuring-autoptimize/