

How to use Google AdSense Ads on Responsive Websites - vinothshankaran
http://www.labnol.org/internet/google-adsense-responsive-design/25252/

======
chrsstrm
_this shouldn’t be against AdSense TOS in my opinion since we aren’t resizing
the ads or modifying the JavaScript code..._

Until Google themselves come out and recommend a method, I'm not risking my
entire Google account on a should or shouldn't. I've read the TOS a while back
and changing an ad after it has been loaded or using js is pretty forbidden.

~~~
grakic
As far as I understand, this will just set ad options dynamically, before the
ad is loaded.

This is why it is not connected with window.onresize event, the ad is loaded
just once and do not change.

~~~
chrsstrm
from
[http://support.google.com/adsense/bin/answer.py?hl=en&an...](http://support.google.com/adsense/bin/answer.py?hl=en&answer=48182)

 _Ad behavior AdSense code may not be altered, nor may the standard behavior,
targeting or delivery of ads be manipulated in any way that is not explicitly
permitted by Google. This includes but is not limited to the following:
clicking Google ads may not result in a new browser window being launched, nor
may Google ads be placed in an IFRAME._

If you ask me, loading different units through conditionals qualifies as
altered. Good way to get hit with the No Explanation Ban Hammer.

~~~
grakic
And what if you do it server side (using user-agent and other info get before
with javascript)? The ad placement is not altered, and it is not adsense code
that is changed in any way.

I understand you want to underline the risks. It is possible Google uses some
automated site code screening which will flag this for a ban. Even than, doing
it server site must be completely legit.

~~~
chrsstrm
We're not talking mobile vs. desktop, we're talking responsive layout
controlled by media queries, which can't be determined until the code hits the
browser and your js (Modernizr or similar) measures the window. UA measures
the screen size, not the window size. Not to mention that in theory, you would
only load one size, but changing the orientation of a device or resizing your
desktop browser window can trigger another breakpoint and essentially hide
your ad, making the whole exercise pointless. And yes, the main point is
always act in fear of Google, until they announce responsive ads.

------
n00dle
I would stay clear from anything that manipulates adsense code.

Google suspended my adsense account for a technique which Google approved /
suggested in their support forums.

~~~
mistercow
I would just stay clear of AdSense, period. Not that I have much of a choice
ever since they randomly decided I was committing click-fraud (I wasn't) a few
years back and banned me.

~~~
f055
I had the exact same situation, click-fraud out of the blue. You can find many
such cases reported. I strongly believe that AdSense for small, powerless
publishers is a scam. Google can do whatever it likes with your ad space and
cut you off whenever.

------
fourstar
I'd recommend wrapping this with inside of window.onresize as well.

