Prebid.js: SizeConfig shouldn't merge sizes of different labels together

Type of issue

This is a bug.

Description

When resolving the bid/adUnit sizes, Prebid doesn’t account for size configs with the same media query but different labels.

Steps to reproduce

With a size config:

// Notice that the media queries are the same
[
  {
    mediaQuery: "(min-width: 768px) and (max-width: 1199px)",
    sizesSupported: [[970, 90], [728, 90], [300, 250]],
    labels: ["myLabelA"]
  },
  {
    mediaQuery: "(min-width: 768px) and (max-width: 1199px)",
    sizesSupported: [[728, 90], [300, 250]],
    labels: ["myLabelB"]
  }
]

and a bid with { labelAny: ['myLabelA'] }, Prebid sends all the five sizes to DFP. I expected it to send only myLabelA sizes to DFP: [[970, 90], [728, 90], [300, 250]].

My use case

I have a bunch of different sections on the website (header, footer, sidebar, fixed ads, in-content, etc) like so:

{
  header: {
    xs: {
      mediaQuery: '(min-width: 576px) and (max-width: 767px)',
      sizes: [[468, 60], [600, 300]]
    },
    sm: {
      mediaQuery: '(max-width: 575px)',
      sizes: [[468, 60], [300, 250]]
    }
  ],
  sidebar: [...]
}

And then in the bids:

// MyAdUnitA
[
  {
    bidder: 'sovrn',
    params: { tagid: '123456' },
    labelAny: ['header-xs', 'header-sm'] },
  },
  // ...
]

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Closing this issue- advanced sizemapping is now a thing – http://prebid.org/dev-docs/modules/sizeMappingV2.html

@bretg I believe that per-bid size configs would make it easier to understand and more powerful.

@mkendall07 - consider this 3 community votes for supporting a per-adunit override for sizeConfig. We should spend some time spec’ing the interaction.

@bretg I think that it would. That approach would be the most flexible and align more closely with GPT responsive config. I’d have to think a bit more about turning adunits off and on which is handled well now in every instance we’ve tried. Labels could be relegated to flags and would align with the merged, non-overlapping approach. Then sizes at the bidder level would be bidder specific and would allow for the size variability that often differs from the off/on decision of an adunit being active.