Google adsense causing large horizontal scrolling on mobile

AI-generated summary

Google Adsense Causing Large Horizontal Scrolling on Mobile

The discussion revolves around an issue with Google Adsense causing horizontal scrolling on mobile devices. zyouchi initially reported the problem and shared images of the issue. Gulshan_Kumar suggested a fix by hiding the Ad unit label using display: none; CSS property, which solved the problem. However, Johani warned that this fix may be against the terms of use for Adsense and is not recommended.

Alternatively, Johani provided a link to a commit on GitHub that fixes the horizontal scroll issue on mobile devices. The fix is available in the discourse-adplugin repository. Gulshan_Kumar defended their initial fix, stating that it does not violate Adsense terms and has provided an excellent experience with the plugin.

Create an ad unit with size 320 * 100 with google adsense and choose 320 * 100 large mobile banner with “adsense mobile topic list top top size” in the discourse management screen, then the mobile design will collapse like the image below.



Does anyone know how to solve this bug?

Can you post a link to the site you’re having trouble with?

1 Like

Horizontal scroll, content falling outside of viewport, this problem I had faced on very first day while using official Ad plugin. This problem occurs on mobile devices.

To fix, just hide Ad unit label using display: none; css property.

horizontal scroll on mobiles fixed via:

https://github.com/discourse/discourse-adplugin/commit/2ed1d1c5d6b456ddbbae71823015d96539a44f68

Thanks for reporting @zyouchi :+1:


This is most likely against the terms of use for adsense and is not recommended.

8 Likes

By default AdSense doesn’t show any label. The plugin itself add a label called “Advertisment” above each ad unit. When I did hide, the problem was fixed. I don’t see it as violation. I am still using this plug-in. Overall, excellent experience.