How would one go about handling Adsense banners in a responsive layout?
As far as I can read from the Adsense TOS, I'm pretty much not allowed to do anything client-side with the banners, so I can't, client-side, switch a banner to a smaller one if it's a low resolution.
It seems the only solution I can find is to only serve banners that work in the lowest target resolution (i.e. 300x250).
Anyone with a better idea?
With responsive display ads, you can upload your assets (images, headlines, logos, videos, and descriptions), and Google will automatically generate ad combinations for websites, apps, YouTube, and Gmail. Responsive display ads can be used in Display campaigns.
Responsive ads automatically adjust their size, appearance, and format to fit available ad spaces. So a single responsive ad may appear as a small text ad in one place and a large image ad in another. To create their ads, advertisers enter their assets (for example, headlines, descriptions, images, and logos).
You should implement responsive ad units. Modifying AdSense code or implementing tricks mentioned in my original answer is no longer necessary.
Boston Globe solved this problem on their famously responsive site by creating a designated advertising column. That column is set to a fixed width large enough to contain the ad, and the ad is never resized, even as the rest of the page adjusts responsively. It's not ideal, but it keeps the ad intact.
It would be great to just load multiple sizes of ads into multiple places on the page, and show/hide based on page size, but obviously Adsense isn't going to go for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With