Skip to content

Commit

Permalink
Colossusssp Bid Adapter: fix traffic param (prebid#8724)
Browse files Browse the repository at this point in the history
* 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 f0c5c24.

* 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 <[email protected]>
Co-authored-by: Aiholkin <[email protected]>
Co-authored-by: Mykhailo Yaremchuk <[email protected]>
  • Loading branch information
4 people authored Jul 25, 2022
1 parent 18306dc commit 852d0ee
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 29 deletions.
50 changes: 28 additions & 22 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
};
Expand All @@ -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) {
Expand Down
35 changes: 29 additions & 6 deletions modules/colossussspBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}]
}];
Expand Down
1 change: 0 additions & 1 deletion test/spec/modules/colossussspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ describe('ColossussspAdapter', function () {
...bid,
params: {
placement_id: 0,
traffic: 'video',
},
mediaTypes: {
video: {
Expand Down

0 comments on commit 852d0ee

Please sign in to comment.