-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support sizemapping for responsive ads #87
Comments
For mappings defined inside It is possible to pull out the sizes defined inside the Do you think we can assume the mapping will be defined as a global? If not, do you think it makes sense to pull the out of the object directly? Another option appears to be parsing the DFP log, but that is less obvious than pulling out of each slot in the Re numbers 1-3 above, would you prefer prebid to determine the size of the window and parse the sizes out of the mapping itself, or just copy what DFP has determined are valid sizes inside the |
the 2nd option would be awesome. Found this API which I think will work -- when you call getSizes() it checks the sizemapping against (what looks like) the window, so it's the eligible sizes I was using one of the obsfucated property paths in another project & it changed when google recompiled GPT, but hopefully this one is a real (just undocumented) api -- slot.getSizes() |
getSizes() is what we have been using for our responsive slot size checks. We also got burned by a GPT recompile when using the GPT object keys. I really wish Google would update GPT. Last I checked the getSizes() is undocumented, but we have not had issues with it failing. Would be nice if they would at least update the docs so we know what is safe or not. |
Thanks for the idea @geoff616 & @nickjacob unfortunately the way we integrate with GPT is after the auction takes place so we need to know the sizes up front. In order to use |
We're working on this ticket this week and should have the proposed solution out in the ticket description in 2 weeks. |
@mkendall07 Has there been any update on this subject? I have pushed live a client with a responsive website and we are now seeing some winning ad's delivering into the wrong size ad sizes. Most ad units have multiple sizes and we are using sizemappling to deliver different sizes based on the users screen size. I'm assuming the wrong size adverts and size mapping are linked. |
There seems to be a mostly functional version with responsive sizes in git. We are also waiting for this to stabilise. In the meantime we use something like this: var BrowserWidth = window.innerWidth && document.documentElement.clientWidth ? Math.min(window.innerWidth, document.documentElement.clientWidth) : window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
pbjs.que.push(function(){
var adUnits = [
{
code: 'div-gpt-ad-firstpost',
sizes: (BrowserWidth > 740) ? [728, 90] : [300, 250],
bids: [
{
bidder: 'appnexus',
params: {
placementId: (BrowserWidth > 740) ? '1234' : '5678'
} Works well enough for the time being. |
We are currently working on a solution for this. You can see the work in progress here: Example usage : https://github.com/prebid/Prebid.js/blob/gpt_sizemapping/integrationExamples/gpt/gpt_sizemapping.html#L130 Any feedback on this solution is welcome. I expect we will merge it in early January once we are confident it's working as expected. |
@mkendall07 @BartVB Do you both think this issue is causing the wrong size ad frame to load around an say larger ad?
|
@mjwhaley any sizes you define into a adUnit are assumed to be "safe" to be delivered there. If you are auto sizing based on screen resolution you need to request only those sizes that would fit into the adjusted size. It sounds like this feature will resolve it for you. |
@mkendall07 Thanks. I will have a look at the solution above. The part i'm find strange is that I'm offering out a 970x250, 970x90 and 300x250 (via the same AdUnit) and the winning bid is a 970x250, but DFP then sizes the window to a 300x250 and then delivers the advert. |
You may need another line item with the correct size that matches to the 'hb_size' param. I'm not a DFP expert so I could be wrong. |
@mkendall07 I've been working on this issue for quite few days now and have even setup additional line items in DFP targeting only, but with no luck sorting it. //UNIT 1 But what seems to be happening is the adapter takes the placementId and then adds the sizes of [970, 90], [728, 90] from the beginning on the ad unit setup. So in my example above its offering the placement twice for each size instead of once per size, as i was expecting it to work. Is this assumption correct? |
@mkendall07 - I was wondering what happened to this URL? https://github.com/prebid/Prebid.js/tree/gpt_sizemapping |
Has any progress been made on this request? I just noticed this is the oldest open issue. I'm setting up prebid with DFP and would like to know how prebid can honor gpt's sizeMapping. |
Agreed with @jorgepinon, any status update? I found this #108, not sure if this has fully been integrated and tested. |
No progress on this unfortunately. We will review PRs for this feature but it's not a priority to build at the moment. |
I'm working on my own work-around for the moment. I have to imagine most sites are responsive in some form nowadays. Subscribing to this. Would love to know when it kicks off, and if I learn anything along the way I can add, even better. |
Why was it closed? |
Agreed with @jorgepinon @minsider @dmsinger, would be nice to have this functionality. So far it seems like custom JS workarounds are required at the moment |
I've added a PR for this feature here #651 |
…nc-with-aol-github to aolgithub-master * commit '0c6c83cc2bfaeeafa9da967c90d83da4af58e7b3': Add change log entry. Renaming and fix missing semicolon. Update parsing script tag regexp. Refactoring. Replace stub bids objects, add additional case for rendering pixels. Refactoring. Replace test consts by methods. Create separate namespace for aol globals, add unit tests. Fix unit tests, remove unnecessary spaces. Implement render pixels only once feature. Add change log entry. Add reporting ID for analytics. Add Facebook Audience Network adapter fix specs update version fix jslint errors Change to using a closure for the callback from ajax to preserve bidObj Ensure cookies get sent in request headers (prebid#1069) Rz/ajax (#5) (prebid#1042)
@nickjacob response was very helpful for me
|
As a publisher using GPT's sizemapping feature, I'd like Prebid.js to auto detect the browser size and read from my GPT sizemapping array, so that Prebid.js can send out ad requests for different ad sizes depending on the user's browser size.
Acceptance Criteria
GPT's sizemapping feature:
https://support.google.com/dfp_premium/answer/3423562?hl=en
If user resizes the browser and GPT refreshes the ad slots with different sizes, header bidding partners cannot easily participate in that round of auction
Because GPT does not have a callback when it detects the resize of a page. Thus when GPT issues a new ad request when it detects a page resize, header bidding partners do not have time or the opportunity to run an auction.
The text was updated successfully, but these errors were encountered: