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

GPT Managed OutOfPage ad slots iframe is not resized #7865

Closed
danielguedesb opened this issue Dec 16, 2021 · 3 comments
Closed

GPT Managed OutOfPage ad slots iframe is not resized #7865

danielguedesb opened this issue Dec 16, 2021 · 3 comments
Assignees

Comments

@danielguedesb
Copy link

Type of issue

bug

Description

Using GPT Managed interstitial slots (https://developers.google.com/publisher-tag/samples/display-web-interstitial-ad), prebid's creative is not resized to its expected size, it stays at 1x1 and the ad is not visible.

Steps to reproduce

  1. Create gpt managed OutOfPage ad slot
  2. Setup prebid with an appropriate configuration and ad units i.e
    pbjs.addAdUnits({ code: 'GAM_AD_UNIT_CODE', mediaTypes: { banner: { sizes: [[300, 250], [300,600], [320,480], [336,280], [480,320]] } }, ortb2Imp: { instl:1 }, bids: [{ bidder: 'appnexus' ... }] })
  3. Request bids, Prebid wins and prebid's universal creative is served (https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/creative.js)

Expected results

Ad Iframe resized to match hb_size size

Actual results

Ad Iframe remains at 1x1 but contains width and height attributes with its expected values.
I.e. width=300 height=600

Other information

GPT Managed OutOfPage slots render the add inside a second iframe:

ad_slot_div [ id=ad_slot_id_0__container ]
--- Iframe1 [ id=google_ads_iframe_ad_unit_code_0 ]
------ Iframe2 [ id=ad_iframe ]
-------- Prebid Universal Creative code

@patmmccann
Copy link
Collaborator

seems to be a partial dupe of #interstitial

@danielguedesb
Copy link
Author

danielguedesb commented Dec 16, 2021

Setting frameElement's style.width and style.height after this sets the correct size:

doc.defaultView.frameElement.style.width = width + 'px';
doc.defaultView.frameElement.style.height = height + 'px';

It doesn't seem to cause any issue / unwanted behaviour at first glance but I'm keen on hearing other opinions.
Thoughts?

@ChrisHuie ChrisHuie self-assigned this Dec 16, 2021
@bretg
Copy link
Collaborator

bretg commented Dec 16, 2021

It does look like this is a duplicate of #5917. Chris and I discussed and put a suggestion over there. Closing this. @danielguedesb - you can re-open if you disagree that it's a duplicate.

@bretg bretg closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants