diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index 9131a8cb581..3c17f609a37 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -4,6 +4,7 @@ import {config} from '../src/config.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; const DEFAULT_INTEGRATION = 'pbjs_lite'; +const DEFAULT_PBS_INTEGRATION = 'pbjs'; // always use https, regardless of whether or not current page is secure export const FASTLANE_ENDPOINT = 'https://fastlane.rubiconproject.com/a/api/fastlane.json'; @@ -182,6 +183,11 @@ export const spec = { // includebidderkeys always false for openrtb includebidderkeys: false, pricegranularity: getPriceGranularity(config) + }, + bidders: { + rubicon: { + integration: config.getConfig('rubicon.int_type') || DEFAULT_PBS_INTEGRATION + } } } } diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index bfc8de0f20d..99928b41d7b 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -7,6 +7,7 @@ import * as utils from 'src/utils.js'; import find from 'core-js-pure/features/array/find.js'; const INTEGRATION = `pbjs_lite_v$prebid.version$`; // $prebid.version$ will be substituted in by gulp in built prebid +const PBS_INTEGRATION = 'pbjs'; describe('the rubicon adapter', function () { let sandbox, @@ -1478,10 +1479,11 @@ describe('the rubicon adapter', function () { expect(post.regs.ext.us_privacy).to.equal('1NYN'); expect(post).to.have.property('ext').that.is.an('object'); expect(post.ext.prebid.targeting.includewinners).to.equal(true); - expect(post.ext.prebid).to.have.property('cache').that.is.an('object') - expect(post.ext.prebid.cache).to.have.property('vastxml').that.is.an('object') - expect(post.ext.prebid.cache.vastxml).to.have.property('returnCreative').that.is.an('boolean') - expect(post.ext.prebid.cache.vastxml.returnCreative).to.equal(false) + expect(post.ext.prebid).to.have.property('cache').that.is.an('object'); + expect(post.ext.prebid.cache).to.have.property('vastxml').that.is.an('object'); + expect(post.ext.prebid.cache.vastxml).to.have.property('returnCreative').that.is.an('boolean'); + expect(post.ext.prebid.cache.vastxml.returnCreative).to.equal(false); + expect(post.ext.prebid.bidders.rubicon.integration).to.equal(PBS_INTEGRATION); }); it('should correctly set bidfloor on imp when getfloor in scope', function () { @@ -1839,6 +1841,18 @@ describe('the rubicon adapter', function () { const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest); expect(request.data.imp[0].ext.context.data.adslot).to.equal('1234567890'); }); + + it('should use the integration type provided in the config instead of the default', () => { + createVideoBidderRequest(); + sandbox.stub(config, 'getConfig').callsFake(function (key) { + const config = { + 'rubicon.int_type': 'testType' + }; + return config[key]; + }); + const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest); + expect(request.data.ext.prebid.bidders.rubicon.integration).to.equal('testType'); + }); }); it('should include pbAdSlot in bid request', function () {