Skip to content

Commit

Permalink
PBJS RP adapter: pass integration type into video calls (prebid#5231)
Browse files Browse the repository at this point in the history
* Add microadBidAdapter

* Remove unnecessary encodeURIComponent from microadBidAdapter

* Submit Advangelists Prebid Adapter

* Submit Advangelists Prebid Adapter 1.1

* Correct procudtion endpoint for prebid

* analytics update with wrapper name

* reverted error merge

* update changed default value of netRevenue to true

* Re-add rubicon analytics without deprecated getTopWindowUrl util

* Cache referrer on auction_init instead of bid_requested

* merged remote master changes

* Include integration type in video OpenRTB requests

Co-authored-by: nakamoto <nakamoto_tatsuya@microad.co.jp>
Co-authored-by: Chandra Prakash <chandra.prakash@advangelists.com>
Co-authored-by: Isaac Dettman <idettman@rubiconproject.com>
Co-authored-by: Eric Harper <eharper@rubiconproject.com>
Co-authored-by: TJ Eastmond <teastmond@la-wlandaverde-mac.local>
Co-authored-by: Mark Monday <mmonday@rubiconproject.com>
  • Loading branch information
7 people authored and iggyfisk committed Jun 22, 2020
1 parent 36c9e71 commit 7d199f4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
6 changes: 6 additions & 0 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
}
}
}
}
Expand Down
22 changes: 18 additions & 4 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit 7d199f4

Please sign in to comment.