Making Adsense Responsive

∥☆過路亽.° 提交于 2019-12-01 03:52:09

Google now has Responsive ad units: https://support.google.com/adsense/answer/3543893

I guess, under your account you might be set up several AdSense units for several dimensions Google offers. Then with Javascript on page load, decide what ad unit to use, based on the screen width and list of available unit dimensions, and inject the corresponding AdSense unit HTML code dynamically:

This should allow you to progressively downgrade the ad width to as low as 120 pixels. Don't know about the TOS however, but the technique looks fairly legal to me.

If for example jQuery would be used and the advertisement should be placed right after the main page title <h1>, something like this would do:

$('The HTML code for the AdSense unit goes here').insertAfter('h1');

You really haven't provided enough information. As you obviously know a "responsive design" can be as simple as floating your content so elements slide underneath each other when they don't fit horizontally.

Therefore you can just float your Adsense iframe to either side of your floated content and drop it underneath everything else when it doesn't fit on screen.

However since you haven't provided a link or any details about your site I have no idea whether that would be acceptable to you. Given you can't change the scale of the AdSense without creating problems for yourself I don't see any other choice you have.

Based on your subresponse, it sounds like this is a mobile ad unit issue. Note that Adsense isn't going to count a web display size (ie: 728x90) on a mobile unit, even if it shows up when you view the page on your mobile browser.

Instead you should use a mobile banner (ie: 320x50) on your mobile page.

Let me know if you have any more questions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!