How to remove Cumulative Layout Shift in connection with Ads?

Posted in: Newspaper
Post count: 361

Is there a way to remove the cumulative layout shift in the desktop version in connection with the ad blocks that have been inserted by using the cloud template/composer?

It seems that the ad slot in the mobile theme doesn’t produce any layout shift. So what is the difference betwenn the embedding between the ad slot for mobile and desktop?

Greetings Kathrin

Post count: 35449

Hi,

The mobile theme is using a standard post post style, using the desktop version you can choose between standard post style and cloud templates, now the cloud templates are made using dynamic elements, when the standard one is a file with static elements.
What you can do is to use one of the standard post style from tagDiv Standard pack, maybe this will solve the problem.

Hope this will help you!
Thank you!

Post count: 361

Thank you very much! But would be there a way to take the ad implementation code from the mobile theme and replace the code from the td composer in the desktop theme with it? Or would it be possible to make the current code static with width and height?

Greetings Kathrin

Post count: 35449

Hi Topfgartenwelt,

The possible way is to set a width and height on current ads, for example you can set your ad inside a div with a height and width set:
<div style="width:300px; height:250px;">
<!-- your ad -->
</div>

Hope this will help you!
Thank you!

Post count: 361

Ok, thanks for the code, but where I should implement the code? Which file and which position?

Greetings Kathrin

Post count: 35449

Hi,

This should be use for the ads that you have in theme panel> ads and in ad box where the ad is set using tagDiv Composer.

Thank you!

Post count: 361

Thank you very much! It seems that the cumulative layout shift is reduced by using the div container.

Greetings Kathrin

Post count: 361

Is it also possible to change the container to another size like 500px x 500px or isn’t that a good idea?

Greetings Kathrin

Post count: 35449

Hi,

You can set the size you link, but if you are using google ads, then you should use one of these size -> https://support.google.com/google-ads/answer/7031480?hl=en

Thank you!

Post count: 361

Thank you very much! But there is still a problem with the div element. I have set it to 300px – 250px as you have recommended. When scrolling just down there is no CLS (cumulative layout shift) but when scrolling up and down the CLS appears again? What is causing that problem? There is no such problem in the mobile theme what kind of code you have used there?

And there is another problem with the responsive ads – it’s completely irrelevant if i use a div container sized 350×250 or 250×250 AdSense always delivers an ad sized 300×600. Why? There shouldn’t be any place for such a size…

Greetings Kathrin

Post count: 35449

Hi,

Unfortunately I do not know what can be the case of the CLS when you scroll up and down, I will try to find some more details about this.

Thank you for your understanding!

Post count: 361

Could this be a problem when the div-container is set to 500×250 px because otherwise the delivered ads have always the wrong size…

Greetings

Post count: 35449

Hi,

You need to use a size that is disposable of ads, I’m not 100% sure, until now I do not see adsense ads set to 500×250px, please try one of the ads size from above link/guide.

Thank you for your understanding!

Post count: 361

So I have changed the container back to 300x250px but then I always get an ad with the scale 300x600px, so I changed the div container to 300x600px… But what about this: https://support.google.com/adsense/answer/9467650?hl=en

Or what about this: https://support.google.com/adsense/answer/9183363

What would be the exact size best fitting to the desktop theme of newspaper?

Greetings Kathrin

Post count: 35449

Hi,

If you want you can try inline ads in adsense, it should work.
Also the best size is the one that is adapt for your set content, if your page is set on full screen, you can use bigger ads, if you use the the full width, you will use smaller ads.

Thank you!

Post count: 361

Thank you!

Viewing 16 posts - 1 through 16 (of 16 total)
The forum ‘Newspaper’ is closed to new topics and replies.