8

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?

4 Answers4

2

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

Paolo Broccardo
  • 1,942
  • 6
  • 34
  • 51
  • 1
    These are certainly a reasonable way to employ responsive ads within the terms of service, though don't change on the user resizing their browser window (only on a page reload). –  Jan 07 '14 at 22:51
2

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');
Petr Vostrel
  • 2,324
  • 16
  • 23
  • I think this is probably the best solution at the moment (even though it doesn't fully do what I was hoping for). It can work for viewing on different devices, however I have users that often like to resize the browser window as they're usually coding while reading my articles (that's something that I don't think this will work for). –  Feb 29 '12 at 21:52
  • It may do even that, I think. You can subscribe to browser's `resize` event and remove the ad as the resizing starts. Employ a few-second idle timer and reset it every time `resize` event pops out. Timer's job will be to ensure values settled for the new decision. Then it's business as before. Measure the space, decide dimensions and inject new fitting ad. – Petr Vostrel Feb 29 '12 at 23:16
  • Interesting idea - think it's against the stupid TOS (people could spam resize - although the idle time somewhat prevents this) but this is probably the best answer to the question. –  Mar 01 '12 at 08:02
  • 5
    Too bad AdSense is still stuck in the 20th century and doesn't seem to recognize responsive design at all... – Petr Vostrel Mar 01 '12 at 12:02
0

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.

sbmiller5
  • 11
  • 3
0

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.

SpliFF
  • 38,186
  • 16
  • 91
  • 120
  • I'm aware I can move the Adsense unit around the page, but the width of a unit doesn't allow for a fully responsive design. My issue is with regards to a mobile width. –  Feb 29 '12 at 15:44