amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

ad resize issue

Open alvin-milton opened this issue 10 years ago • 8 comments

I have a need to render a 2x2 ad that on our current site breaks out of the frame and resizes according to the creative being served.

I have seen some documentation on ad resizing, forked elsewhere and not part of this repo... So I was wondering if this is officially supported and if so, how to actually do it?

ref page: https://github.com/ampproject/amphtml/blob/master/examples/ads.amp.html

Example code: <!--- 2x2 Ad Call --> amp-ad(width='2', height='2', type='doubleclick', data-slot='/5202/google_amp_mob/home_top', json='{"targeting": { "kw": ["nt_test", "amp_test", "' + branded.linkText + '", "promo"]}}', resizable)

alvin-milton avatar Feb 23 '16 00:02 alvin-milton

Do you have tried to use the window.context.requestResize method? It's buggy at the moment, but will be fixed soon: https://github.com/ampproject/amphtml/issues/2192

adtechnology avatar Feb 23 '16 17:02 adtechnology

Docs are here https://github.com/ampproject/amphtml/blob/master/ads/README.md#ad-resizing

Please note that this mechanism is not guaranteed to actually resize the ad; hence the callbacks for when it didn't. If resize is requested after interaction it should always work.

On Tue, Feb 23, 2016 at 9:02 AM, MediaImpact AdTechnology < [email protected]> wrote:

Do you have tried to use the window.context.requestResize method? It's buggy at the moment, but will be fixed soon: #2192 https://github.com/ampproject/amphtml/issues/2192

— Reply to this email directly or view it on GitHub https://github.com/ampproject/amphtml/issues/2214#issuecomment-187792375 .

cramforce avatar Feb 23 '16 17:02 cramforce

ok.

Also tried data-override-height & data-override-width:

amp-ad(width='2', height='2', data-override-width='300', data-override-height='50', type='doubleclick', json='{"targeting": { "kw": ["promo", "nt_test", "amp_test", "' + branded.linkText + '", "promo"]}}')

alvin-milton avatar Feb 23 '16 18:02 alvin-milton

Looks like we had an issue in our DoubleClick code. The data-override-* should be working shortly.

jridgewell avatar Feb 23 '16 18:02 jridgewell

@adtechnology I have seen the requestResize method, but not 100% sure how this is implemented on an amp page.

  1. I read there was no script tags to be used other than pointed to amp resources.
  2. Its not clear if this is to be put in the template (though that is what would make the most sense).
  3. I don't see where I would actually pass in some identifying characteristic of the element that I want to resize, ie. #id...

alvin-milton avatar Feb 23 '16 18:02 alvin-milton

Thanks @jridgewell. waiting.

alvin-milton avatar Feb 23 '16 18:02 alvin-milton

@alvin-milton the data-override issue is fixed.. could you let us know if you are still seeing this or can be closed?

kashyapnitin avatar Mar 02 '16 12:03 kashyapnitin

@kashyapnitin This appears to be working fine now.

This is what I actually need to happen: <!--- 2x2 Ad Call --> amp-ad(width='150', height='50', data-override-width='2', data-override-height='2', type='doubleclick', data-slot='/5202/google_amp_mob', json='{"targeting": { "kw": ["promo", "' + branded.linkText + '", "promo"]}}')

I've tried with other ad sizes in the data-override field and it renders those ads, so now its just a targeting issue for the 2x2.

Thanks!

alvin-milton avatar Mar 16 '16 16:03 alvin-milton