I've started using the method described here http://www.labnol.org/internet/google-adsense-responsive-design/25252/ for responsive google adsense ads. Any chance this type of functionality could be built into Managed Ads blocks?

I'll do some looking into the existing code and see if anything pops out.

CommentFileSizeAuthor
#9 responsive ad.png178.55 KBsubhojit777

Comments

jcnventura’s picture

Status: Active » Postponed

It would be possible, not sure however, if this should be handled by the module, or by the theme.. You can create the different ad blocks with the module, and have the theme enable/disable the appropriate block.

jcnventura’s picture

Component: Code » Wishlist
mrP’s picture

@jcnventura - That's certainly a viable approach. I've struggled with theme level block display alternatives where caching is concerned.

Nonetheless, there are usable solutions out there without needing to build it into this module.

Thanks for your feedback.

jcnventura’s picture

Also, note that Google is rolling out some async code that seems to make it a lot easier to get a responsive ad size. I may add a drupal_alter call to allow themes to change the ad size easily.

I have no idea how to create a generic algorithm to adjust the responsive ad size. I think this really needs to be a theme-level decision.

bunthorne’s picture

I see that Google is now announcing Responsive Ads as a beta feature, with instructions here . I don't know how to do that with the existing AdSense module.

I'm still a beginner at theming, but I wonder why they can't make use of max-width: 100% for blocks?

jcnventura’s picture

Issue summary: View changes
Status: Postponed » Fixed

I've added support for Google's responsive ads solution.

http://drupalcode.org/project/adsense.git/commit/30e9e7b

mrP’s picture

Very nice! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

subhojit777’s picture

Status: Closed (fixed) » Needs work
StatusFileSize
new178.55 KB

I do not think the issue fixed. I am using this token [adsense:responsive:xxxx], but I do not responsive ad. This is what I get.

subhojit777’s picture

Status: Needs work » Fixed

Seems like it does not work on window resize, but works in mobile devices though. Google ads were rendering properly in mobile devices and there were no horizontal scrollbars. Thanks :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

summit’s picture

Status: Closed (fixed) » Needs work

Hi,
I do not think this is completely fixed see also https://www.drupal.org/node/2585355
I am not able to get responsive ads working as block or as token.

Greetings, Martijn

jcnventura’s picture

Status: Needs work » Closed (fixed)

Opening two issues only helps to waste everyone's time.

summit’s picture

Hi,
That was not my intention. I thought token and working of the block where different issues.
Sorry if I misinterpreted.
Greetings, Martijn