Skip to content

Commit

Permalink
FreeWheel SSP Bid Adapter: support video context and placement (#9792)
Browse files Browse the repository at this point in the history
* FreeWheel add floor price

* FreeWheel code update

* FreeWheel-SSP-Adapter: Update to use Vast 4.2 by default

* FreeWheel-SSP-Adapter add userIdAsEids support

* Freewheel-SSP-Adapter add test for eids

* Freewheel SSP Adapter: add prebid version in request

* code cleanup

* FreeWheel SSP Bid Adapter: support video context and placement

* update test
  • Loading branch information
xwang202 committed Apr 11, 2023
1 parent 20fdfcc commit 44f52c4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,14 @@ export const spec = {
requestParams.playerSize = playerSize[0] + 'x' + playerSize[1];
}

// Add video context and placement in requestParams
if (currentBidRequest.mediaTypes.video) {
var videoContext = currentBidRequest.mediaTypes.video.context ? currentBidRequest.mediaTypes.video.context : 'instream';
var videoPlacement = currentBidRequest.mediaTypes.video.placement ? currentBidRequest.mediaTypes.video.placement : 1;
requestParams.video_context = videoContext;
requestParams.video_placement = videoPlacement;
}

return {
method: 'GET',
url: FREEWHEEL_ADSSETUP,
Expand Down
37 changes: 37 additions & 0 deletions test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ describe('freewheelSSP BidAdapter Test', () => {
}
];

it('should return context and placement with default values', () => {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload.video_context).to.equal('instream'); ;
expect(payload.video_placement).to.equal(1);
});

it('should add parameters to the tag', () => {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
Expand Down Expand Up @@ -319,6 +326,36 @@ describe('freewheelSSP BidAdapter Test', () => {
});
})

describe('buildRequestsForVideoWithContextAndPlacement', () => {
let bidRequests = [
{
'bidder': 'freewheel-ssp',
'params': {
'zoneId': '277225'
},
'adUnitCode': 'adunit-code',
'mediaTypes': {
'video': {
'context': 'outstream',
'placement': 2,
'playerSize': [300, 600],
}
},
'sizes': [[300, 250], [300, 600]],
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
}
];

it('should return input context and placement', () => {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload.video_context).to.equal('outstream'); ;
expect(payload.video_placement).to.equal(2);
});
})

describe('interpretResponseForBanner', () => {
let bidRequests = [
{
Expand Down

0 comments on commit 44f52c4

Please sign in to comment.