Making Adsense Responsive

I'm a site owner, currently using Adsense to monetize. I've decided to change my site design to a responsive design so that the website can present itself appropriately on a variety of screen sizes, but unfortunately Adsense isn't very flexible with regards to this. It's relatively simple to simply hide large desktop advertising when the screen width gets too small, but this isn't good for revenue and from what I've read might be against Google's Terms Of Service.

Can anyone think of any way to do something with Adsense so it works intuitively with a responsive design?


Google现在拥有自适应广告单元: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.

链接地址: http://www.djcxy.com/p/10468.html

上一篇: 面向游戏的汇编程序Lisp

下一篇: 使Adsense响应