Multiple users are experiencing screen jumps on mobile devices when using AdSense responsive ads, specifically with the “insert an ad every nth post” option activated. Cazadividendos and Paracelsus report the issue on iPhone, while Paracelsus also experiences it on Android.
neil suspects the issue might be related to the ad platform and size. Cazadividendos confirms using AdSense with responsive ad sizes. Paracelsus offers to reactivate the problematic option so neil can investigate.
neil tries to summarize the issue and provides a potential solution by adding CSS dimensions to the ad container. However, AdSense’s JavaScript overrides these styles, making it difficult to fix the issue. neil proposes four options to address the problem:
Remove “responsive” as a size option from the AdSense plugin.
Remove “responsive” only for between-posts placements.
Write a topic about the problem and link to it in the AdSense size settings.
Add max size parameters to the Discourse settings UI.
My take: it is not a performance issue and whatever was fixed in July was not enough since it still occurs on mobile (the jumpiness) and only if the option to insert an ad every nth post is activated.
It was so annoying and disturbing to our users that we’ve had to just remove that option.
I thought @eviltrout figured it out and it was fixed. @Cazadividendos@Paracelsus Which ad platform? Which ad size? You’re saying that the jumpiness is only on mobile?
The problem only was reported on iphone. In android it works as expected, without jumps.
Ad Platform: Adsense
Ad Size: responsive size (both por general and mobile ads)
Adsense nth post code: 5
I have (had) exactly the same settings of Cazadividendos except for the ads being every 10th post and both Android and IPhone users reporting the same behavior (specially on mobile Chrome).
Actually, I suspect the same thing happened in desktop version, but since there’s so much more vertical area you can still find it visually without having to re-scroll the whole time.
If you wish I can activate it and you can see for yourself, would that help @neil?
I can’t find anything in the ad plugin or in core discourse that is adding these inline !IMPORTANT styles, so it looks like the adsense js has chosen the nuclear option and really wants to impose arbitrary heights on the container. So auto !important everything!
So it looks like AdSense has made it impossible. Options now are:
Remove “responsive” as a size option from the AdSense plugin (fallback to 728x90 desktop, 300x250 mobile for those who are using the responsive size currently).
Remove “responsive” only for between-posts placements (even though the jumping happens in all placements).
Write a topic here on meta about the problem, allow people to keep using “responsive”, and link to it in the description of all AdSense size settings.
The “auto !important” is coming from the ad plugin or core discourse and I can’t find it?
EDIT:
Maybe I understand this suggestion now:
So you’d need to be able to select “responsive” and then set the max width and max height in the plugin settings.