From 852d0eeafe930f249cd85760b9d31d4c03b166b1 Mon Sep 17 00:00:00 2001 From: Bill Newman Date: Mon, 25 Jul 2022 20:12:08 +0300 Subject: [PATCH] Colossusssp Bid Adapter: fix traffic param (#8724) * add video&native traffic colossus ssp * Native obj validation * Native obj validation #2 * Added size field in requests * fixed test * fix merge conflicts * move to 3.0 * move to 3.0 * fix IE11 new URL issue * fix IE11 new URL issue * fix IE11 new URL issue * https for 3.0 * add https test * add ccp and schain features * fix test * sync with upstream, fix conflicts * Update colossussspBidAdapter.js remove commented code * Update colossussspBidAdapter.js lint fix * identity extensions * identity extensions * fix * fix * fix * fix * fix * add tests for user ids * fix * fix * fix * fix * fix * fix * fix * add gdpr support * add gdpr support * id5id support * Update colossussspBidAdapter.js add bidfloor parameter * Update colossussspBidAdapter.js check bidfloor * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter_spec.js * use floor module * Revert "use floor module" This reverts commit f0c5c248627567e669d8eed4f2bb9a26a857e2ad. * use floor module * update to 5v * fix * add uid2 and bidFloor support * fix * add pbadslot support * fix conflicts * add onBidWon * refactor * add test for onBidWon() * fix * add group_id * Trigger circleci * fix * update user sync * fix window.location * fix test * updates * fix conflict * fix * updates * remove traffic param Co-authored-by: Vladislav Isaiko Co-authored-by: Aiholkin Co-authored-by: Mykhailo Yaremchuk --- modules/colossussspBidAdapter.js | 50 +++++++++++-------- modules/colossussspBidAdapter.md | 35 ++++++++++--- .../modules/colossussspBidAdapter_spec.js | 1 - 3 files changed, 57 insertions(+), 29 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index cd0721fa80f..eb6215765e1 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -108,12 +108,11 @@ export const spec = { for (let i = 0; i < validBidRequests.length; i++) { let bid = validBidRequests[i]; - let traff = bid.params.traffic || BANNER; + const { mediaTypes } = bid; let placement = { placementId: bid.params.placement_id, groupId: bid.params.group_id, bidId: bid.bidId, - traffic: traff, eids: [], floor: {} }; @@ -134,32 +133,39 @@ export const spec = { rtiPartner: 'TDID' }); } - if (traff === BANNER) { - placement.sizes = bid.mediaTypes[BANNER].sizes - } else if (traff === VIDEO) { - placement.sizes = bid.mediaTypes[VIDEO].playerSize; - placement.playerSize = bid.mediaTypes[VIDEO].playerSize; - placement.minduration = bid.mediaTypes[VIDEO].minduration; - placement.maxduration = bid.mediaTypes[VIDEO].maxduration; - placement.mimes = bid.mediaTypes[VIDEO].mimes; - placement.protocols = bid.mediaTypes[VIDEO].protocols; - placement.startdelay = bid.mediaTypes[VIDEO].startdelay; - placement.placement = bid.mediaTypes[VIDEO].placement; - placement.skip = bid.mediaTypes[VIDEO].skip; - placement.skipafter = bid.mediaTypes[VIDEO].skipafter; - placement.minbitrate = bid.mediaTypes[VIDEO].minbitrate; - placement.maxbitrate = bid.mediaTypes[VIDEO].maxbitrate; - placement.delivery = bid.mediaTypes[VIDEO].delivery; - placement.playbackmethod = bid.mediaTypes[VIDEO].playbackmethod; - placement.api = bid.mediaTypes[VIDEO].api; - placement.linearity = bid.mediaTypes[VIDEO].linearity; + + if (mediaTypes && mediaTypes[BANNER]) { + placement.traffic = BANNER; + placement.sizes = mediaTypes[BANNER].sizes; + } else if (mediaTypes && mediaTypes[VIDEO]) { + placement.traffic = VIDEO; + placement.sizes = mediaTypes[VIDEO].playerSize; + placement.playerSize = mediaTypes[VIDEO].playerSize; + placement.minduration = mediaTypes[VIDEO].minduration; + placement.maxduration = mediaTypes[VIDEO].maxduration; + placement.mimes = mediaTypes[VIDEO].mimes; + placement.protocols = mediaTypes[VIDEO].protocols; + placement.startdelay = mediaTypes[VIDEO].startdelay; + placement.placement = mediaTypes[VIDEO].placement; + placement.skip = mediaTypes[VIDEO].skip; + placement.skipafter = mediaTypes[VIDEO].skipafter; + placement.minbitrate = mediaTypes[VIDEO].minbitrate; + placement.maxbitrate = mediaTypes[VIDEO].maxbitrate; + placement.delivery = mediaTypes[VIDEO].delivery; + placement.playbackmethod = mediaTypes[VIDEO].playbackmethod; + placement.api = mediaTypes[VIDEO].api; + placement.linearity = mediaTypes[VIDEO].linearity; + } else if (mediaTypes && mediaTypes[NATIVE]) { + placement.traffic = NATIVE; + placement.native = mediaTypes[NATIVE]; } + if (typeof bid.getFloor === 'function') { let tmpFloor = {}; for (let size of placement.sizes) { tmpFloor = bid.getFloor({ currency: 'USD', - mediaType: traff, + mediaType: placement.traffic, size: size }); if (tmpFloor) { diff --git a/modules/colossussspBidAdapter.md b/modules/colossussspBidAdapter.md index 4187dfbf36e..45af89580c1 100644 --- a/modules/colossussspBidAdapter.md +++ b/modules/colossussspBidAdapter.md @@ -22,22 +22,45 @@ Module that connects to Colossus SSP demand sources bids: [{ bidder: 'colossusssp', params: { - placement_id: 0, - traffic: 'banner' + placement_id: 0 } }] }, { code: 'placementid_1', mediaTypes: { - banner: { - sizes: [[300, 250], [300,600]] + video: { + playerSize: [ [640, 480] ], + context: 'instream', + minduration: 5, + maxduration: 60, } }, bids: [{ bidder: 'colossusssp', params: { - group_id: 0, - traffic: 'banner' + group_id: 0 + } + }] + }, { + code: 'placementid_2', + mediaTypes: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + }, + bids: [{ + bidder: 'colossusssp', + params: { + placement_id: 0, } }] }]; diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index da050b3af90..f32a0bf4ebe 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -118,7 +118,6 @@ describe('ColossussspAdapter', function () { ...bid, params: { placement_id: 0, - traffic: 'video', }, mediaTypes: { video: {