Maybe collapse ad units if not ads?
CompletedI see this scene a lot with Journey ads on my website:

Apparently, there were no ads to run to target me on that page.
That's fine.
But maybe at least collapse the ad unit and don't show it to users if you don't have ads to show? What's the point of showing this gray box with 3 dots without any content inside it?
And it repeats across the article multiple times, creating a very horrible UX for readers.
I think Adsense collapses ad-units by default as well if they don't have ads.
-
Hi Muhammad,
Thanks for reaching out. The ad boxes that you sent a screenshot of are designed to keep the ads from causing any CLS issues when they load in. The ad boxes load in first, and then the individual ads can load and refresh inside of the ad boxes. If the boxes didn't reserve the space, the ads could cause CLS by pushing down other content when the load in.
One additional thing to keep in mind is that you're likely being served fewer ads than a typical reader since you're likely on the site more often and may be out of premium impressions.
Thanks!!
0 -
John Thanks for your answer.
As far as I know, CLS is only affected if the content changes after a page load. As long as ads are not in the viewport after the page load, then there should be no effect on the CLS score.
The user, before starting any interaction with the page, will not see ads (if they don't exist) because the ad script has already decided to collapse the ad units, which should not cause a CLS loss in score. Ad units are already out of reach from his/her view, so collapsing them should not affect CLS.
Again I emphasize that Google already does this; if it is causing issues like you described then Adsense would have kept empty ads all over the place - but they don't, suggesting that indeed this is something possible.
Hint: Journey ads/Grow are already causing a big loss in Pagespeed score because of script blocking:
0 -
Hi Muhammed Hanny Sabbagh ! CLS isn't only measured for the first viewport – it's measured throughout the lifespan of a page. This is from one of Google's articles on CLS:
"CLS is a measure of the largest burst of layout shift scores for every unexpected layout shift that occurs during the entire lifecycle of a page."
So if the ad boxes were to expand/collapse dynamically, this would cause CLS. This is how ads used to load a few years back and it did cause CLS, which is why we use the ad boxes. The ad boxes are specifically designed to prevent CLS and are used on over 10k Mediavine and Journey sites, so we can confidently say they don't cause CLS. They're also great for ad viewability/performance since the ad scrolls with the user.
If you have further questions about the inview ad boxes you can refer to this existing thread, and you can refer to this thread for a variety of page speed resources and more information about Journey and page speed if you're interested!
0
Journey is Self Supported
Post is closed for comments.
Comments
3 comments