Skip to content

Commit

Permalink
Compass Adapter: update bid params (prebid#7897)
Browse files Browse the repository at this point in the history
* add Compass Adapter

* fix

* fix

* fix

* add endpointId
  • Loading branch information
CompassSSP authored and Chris Pabst committed Jan 10, 2022
1 parent 8450e55 commit 6191728
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modules/compassBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,23 @@ function isBidResponseValid(bid) {
function getPlacementReqData(bid) {
const { params, bidId, mediaTypes } = bid;
const schain = bid.schain || {};
const { placementId } = params;
const { placementId, endpointId } = params;
const bidfloor = getBidFloor(bid);

const placement = {
placementId,
bidId,
schain,
bidfloor
};

if (placementId) {
placement.placementId = placementId;
placement.type = 'publisher';
} else if (endpointId) {
placement.endpointId = endpointId;
placement.type = 'network';
}

if (mediaTypes && mediaTypes[BANNER]) {
placement.adFormat = BANNER;
placement.sizes = mediaTypes[BANNER].sizes;
Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/compassBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe('CompassBidAdapter', function () {
expect(placement.bidId).to.be.a('string');
expect(placement.schain).to.be.an('object');
expect(placement.bidfloor).to.exist.and.to.equal(0);
expect(placement.type).to.exist.and.to.equal('publisher');

if (placement.adFormat === BANNER) {
expect(placement.sizes).to.be.an('array');
Expand Down

0 comments on commit 6191728

Please sign in to comment.