The Cumulative Layout Shift can occur during the loading of ads within the site content.
This can happen for both in-article and standard banners.
Often, what a user may notice is that an ad will begin loading and shift the content on the page. Google now considers this one of the web vitals taken into account for search results. If your site relies on search traffic, you've probably heard about it.
HBAgency has defined a global CSS file to allow the publisher to use it directly with other header scripts. We prefer hosting the script on our CDN to simplify update operations, but you can also copy the styles into your stylesheet.
The provided ads already have attributes that we use to style the divs containing the ads. To make the ads CLS-compliant, we need to set a fixed height on the ad slot itself. This means that if you're using flexible sizes, like 300x250 and 300x600, the height of the container containing the ad will be 600px.
If a 300x250 ad is served in this space, we will vertically center the ad.
To make the tags compatible, insert the following CSS into the head of your site:
<link rel="stylesheet" href="https://hbagency.it/cdn/stylehb.css">
If you have been a registered publisher for a while, you may have divs on the page without the corresponding class attribute. If that is the case, please retrieve the divs from the platform or contact your account manager.
As a publisher, you may choose not to consider CLS. To do this, simply remove the CSS file from your site.
If you have further questions, please contact your account manager.