Forum Moderators: martinibuster

Message Too Old, No Replies

Best way to use responsive ads?

some design decisions are not clear to me

         

FourDegreez

4:18 pm on Feb 15, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assume a site layout consisting of a header of 100% width, two columns below that are 25% and 75% width, then a 100% width footer. Let's talk about the 25% width column. I want a tower ad to appear there. On someone's browser, say the column is 200px wide. AdSense will serve a 160px wide ad as the best fit, yes? But this will look strange as there will be 40px of width not filled. I could center it inside a styled box, but it would still look off.

I've searched for ways to achieve one fixed-width column and one that grows, but the methods all seem hackish. One elegant solution involved floating both columns left and setting a margin of -100% on the fixed-width column, which (unintuitively) puts it into the desired position. But I'm leery of using this for a number of reasons.

A better solution (to my mind) might be to have some javascript that executes on document ready to snap the column widths to sizes appropriate for ad slots. The 200px column would shrink by 40px and the other column would grow by the same. The downside would be that users may notice the browser redrawing the layout. I wonder what solutions other people are using?


Here's another question. The responsive ads are fed to ad slots via javascript, correct? (I haven't used the new code yet.) Does this mean I can make a choice about where the ad is placed at page load time? Let's say I want a leaderboard to appear in the 75% width column, but only if the column is wide enough for it. If the column is not wide enough, I want a leaderboard to instead appear in the header. Easy enough to do with javascript, but will AdSense have a problem with this?

I'm interested to learn from those with more experience on this topic!

webcentric

6:15 pm on Feb 15, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Make sure you're not just hiding the ads you don't want shown (meaning that they are in your page source but don't show on the page because you've hidden the container with css or some technique like that). I use server-side programming to generate ad blocks based on a variety of parameters (51Degrees.mobi for example can be used to determine different devices in conjunction with server-side code to show or hide stuff that just won't work for that device's screen dimensions). Fixed width columns used in conjunction with dynamic columns can offer some control. You can also set specific breakpoints with responsive ads (using CSS) and tell Adsense exactly the size ad you want served for a specific breakpoint. Text ads tend to fill dynamic spaces (using smart sizing) better than image ads due to the fact that image ads are only available in set widths. Your 200px column for example will have extra horizontal space if you're using display ads but text ads should fill the space more fully. Where JS is concerned, this is a question I've had in the past. If your source code shows your own script but generates a Google ad, is that an Adsense Policy violation or not? I've got so many other ways to get the job done though that I've never really pushed the issue.