Skip to content

Commit

Permalink
FreeWheel Bid Adapter: support passing content object in config (#10588)
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

* FreeWheel SSP Bid Adapter: add GPP support

* Freewheel SSP Bid Adapter: test update

* FreeWheel SSP Adapter: update the default value for video placement and context

* update test

* FreeWheel SSP Adapter: add support for video.plcmt

* FreeWheel Adapter: support content object in config

* code update
  • Loading branch information
xwang202 authored Oct 17, 2023
1 parent 20bbae2 commit 3f6819b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,15 @@ export const spec = {
requestParams.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
}

// Add content object
if (typeof config.getConfig('content') === 'object') {
try {
requestParams._fw_prebid_content = JSON.stringify(config.getConfig('content'));
} catch (error) {
logWarn('PREBID - ' + BIDDER_CODE + ': Unable to stringify the content object: ' + error);
}
}

// Add schain object
var schain = currentBidRequest.schain;
if (schain) {
Expand Down
15 changes: 15 additions & 0 deletions test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { expect } from 'chai';
import { spec } from 'modules/freewheel-sspBidAdapter.js';
import { newBidder } from 'src/adapters/bidderFactory.js';
import { createEidsArray } from 'modules/userId/eids.js';
import { config } from 'src/config.js';

const ENDPOINT = '//ads.stickyadstv.com/www/delivery/swfIndex.php';
const PREBID_VERSION = '$prebid.version$';
Expand Down Expand Up @@ -117,6 +118,20 @@ describe('freewheelSSP BidAdapter Test', () => {
}
];

it('should get correct value from content object', () => {
config.setConfig({
content: {
'title': 'freewheel',
'series': 'abc',
'id': 'iris_5e7'
}
});

const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload._fw_prebid_content).to.deep.equal('{\"title\":\"freewheel\",\"series\":\"abc\",\"id\":\"iris_5e7\"}');
});

it('should get bidfloor value from params if no getFloor method', () => {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
Expand Down

0 comments on commit 3f6819b

Please sign in to comment.