Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ad resize issue #2214

Closed
alvin-milton opened this issue Feb 23, 2016 · 8 comments
Closed

ad resize issue #2214

alvin-milton opened this issue Feb 23, 2016 · 8 comments

Comments

@alvin-milton
Copy link

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)

@adtechnology
Copy link

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

@cramforce
Copy link
Member

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 <
notifications@github.com> wrote:

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


Reply to this email directly or view it on GitHub
#2214 (comment)
.

@alvin-milton
Copy link
Author

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"]}}')

@jridgewell
Copy link
Contributor

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

@alvin-milton
Copy link
Author

@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
Copy link
Author

Thanks @jridgewell. waiting.

@kashyapnitin
Copy link

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

@alvin-milton
Copy link
Author

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants