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

Improve creative resizing logic #191

Open
dgirardi opened this issue Nov 9, 2022 · 1 comment
Open

Improve creative resizing logic #191

dgirardi opened this issue Nov 9, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@dgirardi
Copy link
Collaborator

dgirardi commented Nov 9, 2022

When using native-render.js, after the ad is rendered, we take the ad height and send it to Prebid for it to be set on the frame's container:

requestHeightResize(bid.adId, (document.body.clientHeight || document.body.offsetHeight), document.body.clientWidth);

This is because GPT will fix the safeframe's height based on the contents it knows about, and it does not know that we are dynamically generating it. However, this approach has problems (see #190 (comment)):

  • at the time we requestHeightResize, we do not necessarily know the true height of the creative, because images and scripts may still need to be loaded. We should try to wait until page load is complete before requesting the resize.
  • it is possible to tell GPT to allow height: auto safeframes (allowPushExpansion), in which case we should not fix the height ourselves.
@dgirardi dgirardi added the bug Something isn't working label Nov 21, 2022
@patmmccann
Copy link

allowPushExpansion support still needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready for Dev
Development

No branches or pull requests

2 participants