Skip to content

Commit

Permalink
FreeWheel SSP Adapter: add gvlid in spec (prebid#10654)
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

* FreeWheel SSP Adapter: add gvlid in spec

* FreeWheel SSP Adapter: update code for site.content

* FreeWheel SSP Adapter: code update

* FreeWheel SSP Adapter: code update

* FreeWheel SSP Adapter: code update

* FreeWheel SSP Adapter: code update
  • Loading branch information
xwang202 authored Nov 1, 2023
1 parent 981459b commit 7c25daa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
6 changes: 4 additions & 2 deletions modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';

const BIDDER_CODE = 'freewheel-ssp';
const GVL_ID = 285;

const PROTOCOL = getProtocol();
const FREEWHEEL_ADSSETUP = PROTOCOL + '://ads.stickyadstv.com/www/delivery/swfIndex.php';
Expand Down Expand Up @@ -314,6 +315,7 @@ var getOutstreamScript = function(bid) {

export const spec = {
code: BIDDER_CODE,
gvlid: GVL_ID,
supportedMediaTypes: [BANNER, VIDEO],
aliases: ['stickyadstv', 'freewheelssp'], // aliases for freewheel-ssp
/**
Expand Down Expand Up @@ -383,9 +385,9 @@ export const spec = {
}

// Add content object
if (typeof config.getConfig('content') === 'object') {
if (bidderRequest && bidderRequest.ortb2 && bidderRequest.ortb2.site && bidderRequest.ortb2.site.content && typeof bidderRequest.ortb2.site.content === 'object') {
try {
requestParams._fw_prebid_content = JSON.stringify(config.getConfig('content'));
requestParams._fw_prebid_content = JSON.stringify(bidderRequest.ortb2.site.content);
} catch (error) {
logWarn('PREBID - ' + BIDDER_CODE + ': Unable to stringify the content object: ' + error);
}
Expand Down
23 changes: 9 additions & 14 deletions test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,6 @@ 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 Expand Up @@ -218,6 +204,14 @@ describe('freewheelSSP BidAdapter Test', () => {
let bidderRequest = {
'gdprConsent': {
'consentString': gdprConsentString
},
'ortb2': {
'site': {
'content': {
'test': 'news',
'test2': 'param'
}
}
}
};

Expand All @@ -231,6 +225,7 @@ describe('freewheelSSP BidAdapter Test', () => {
expect(payload.playerSize).to.equal('300x600');
expect(payload._fw_gdpr_consent).to.exist.and.to.be.a('string');
expect(payload._fw_gdpr_consent).to.equal(gdprConsentString);
expect(payload._fw_prebid_content).to.deep.equal('{\"test\":\"news\",\"test2\":\"param\"}');

let gdprConsent = {
'gdprApplies': true,
Expand Down

0 comments on commit 7c25daa

Please sign in to comment.