diff --git a/modules/compassBidAdapter.js b/modules/compassBidAdapter.js index 21fc4e71c97..a1d1ff9c8c3 100644 --- a/modules/compassBidAdapter.js +++ b/modules/compassBidAdapter.js @@ -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; diff --git a/test/spec/modules/compassBidAdapter_spec.js b/test/spec/modules/compassBidAdapter_spec.js index dc885303a7b..28021c4f7c0 100644 --- a/test/spec/modules/compassBidAdapter_spec.js +++ b/test/spec/modules/compassBidAdapter_spec.js @@ -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');