Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Question: Usage of adUnits.sizes will eventually be deprecated.

Open headerbidding opened this issue 8 years ago • 9 comments

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. (eg mediaTypes.banner.sizes)."

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. (eg mediaTypes.banner.sizes). t.logWarn @ prebid.js:3 (anonymous) @ prebid.js:3 t.checkBidRequestSizes @ prebid.js:3 t.makeBidRequests @ prebid.js:3 callBids @ prebid.js:3 (anonymous) @ prebid.js:3 (anonymous) @ prebid.js:3 (anonymous) @ hilarious-apple-engineer-explains-the-new-macbook-pros-lack-of-ports.htm?pbjs_debug=true:445 (anonymous) @ prebid.js:3 i @ prebid.js:3 b.processQueue @ prebid.js:3 (anonymous) @ prebid.js:12

My code: http://www.flixxy.com/prebid.htm

headerbidding avatar Mar 09 '18 02:03 headerbidding

I'm not seeing the warning on that page, are you still getting it?

matthewlane avatar Mar 09 '18 18:03 matthewlane

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

headerbidding avatar Mar 09 '18 19:03 headerbidding

I tried adding the above which is

mediaTypes: {

banner: {

but it did not fix the issue for me. :)

Any help will be much appreciated.

ShashankSureshMindEra avatar Jul 16 '18 10:07 ShashankSureshMindEra

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.

YOzaz avatar Jul 17 '18 05:07 YOzaz

Thanks @YOzaz . Can you let me know the format of the new ad unit sizes ?

ShashankSureshMindEra avatar Jul 17 '18 05:07 ShashankSureshMindEra

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.

YOzaz avatar Jul 17 '18 06:07 YOzaz

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 ?

ShashankSureshMindEra avatar Jul 17 '18 06:07 ShashankSureshMindEra

New Code: "mediaTypes": { "banner": { "sizes": [ [ 320, 50 ] ], } },

Old Code: "sizes": [ [ 320, 50 ] ],

ShashankSureshMindEra avatar Jul 17 '18 06:07 ShashankSureshMindEra

@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.

jsnellbaker avatar Jul 17 '18 16:07 jsnellbaker