ad resize issue
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)
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
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 .
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"]}}')
Looks like we had an issue in our DoubleClick code. The data-override-* should be working shortly.
@adtechnology I have seen the requestResize method, but not 100% sure how this is implemented on an amp page.
- I read there was no script tags to be used other than pointed to amp resources.
- Its not clear if this is to be put in the template (though that is what would make the most sense).
- I don't see where I would actually pass in some identifying characteristic of the element that I want to resize, ie. #id...
Thanks @jridgewell. waiting.
@alvin-milton the data-override issue is fixed.. could you let us know if you are still seeing this or can be closed?
@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!