Question: Usage of adUnits.sizes will eventually be deprecated.
With prebid 1.x.x I get this message in the Console now: "WARNING: Usage of adUnits.sizes will eventually be deprecated. Please define size dimensions within the corresponding area of the mediaTypes.
I am not using the expression "adUnits.sizes"
Can someone explain?
Expanded Warning message: (3) prebid.js:3 WARNING: Usage of adUnits.sizes will eventually be deprecated. Please define size dimensions within the corresponding area of the mediaTypes.
My code: http://www.flixxy.com/prebid.htm
I'm not seeing the warning on that page, are you still getting it?
I figured it out. Addding
mediaTypes: {
banner: {
fixed it.
New code:
var adUnits = [{
code: 'div-gpt-ad-xxxxxxxxxxxxxx',
mediaTypes: {
banner: {
sizes: [[300, 250], [250, 250]]
}},
From: Matt Lane [mailto:[email protected]] Sent: Friday, March 9, 2018 1:11 PM To: prebid/Prebid.js Cc: Flixxy; Author Subject: Re: [prebid/Prebid.js] Question: Usage of adUnits.sizes will eventually be deprecated. (#2248)
I'm not seeing the warning on that page, are you still getting it?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/prebid/Prebid.js/issues/2248#issuecomment-371897259 , or mute the thread https://github.com/notifications/unsubscribe-auth/AP62Ih_HiCX6-Q90xeYM6u31Io9_oBesks5tcsWigaJpZM4Sjq0I . https://github.com/notifications/beacon/AP62IvSAB2EBd9ahfqW4qAMCS-BnkXhxks5tcsWigaJpZM4Sjq0I.gif
I tried adding the above which is
mediaTypes: {
banner: {
but it did not fix the issue for me. :)
Any help will be much appreciated.
Hi guys. You're probably doing multiple ad requests to pbjs with the same configuration on a page (e.g. because of ad refresh).
This message is caused because pbjs is doing backwards-compatible copy of banner > sizes object here: https://github.com/prebid/Prebid.js/blob/master/src/adaptermanager.js#L241.
Second request will cause deprecation message, but can be safely ignored as long as you're using new ad unit sizes format.
Thanks @YOzaz . Can you let me know the format of the new ad unit sizes ?
mediaTypes > banner > sizes: http://prebid.org/dev-docs/adunit-reference.html#adunitmediatypesbanner. In other words, just ignore this message for now, or check if you've replaced general sizes array everywhere.
I replaced the general adUnits.sizes to adUnits.mediaTypes.banner.sizes and it works fine. Do you think this is a mandatory change which is required or can we ignore it ?
New Code:
"mediaTypes": {
"banner": {
"sizes": [
[
320,
50
]
],
}
},
Old Code:
"sizes": [
[
320,
50
]
],
@ShashankSureshMindEra the mediaTypes approach is the direction we'll want to take eventually, so I would recommend to implement it that way if possible so it's an easier transition later on.