Skip to content

Commit

Permalink
Rubicon bid adapter: remove pchain support (prebid#9621)
Browse files Browse the repository at this point in the history
* Rubicon adapter - remove pchain support

* removing pchain from unit tests
  • Loading branch information
bretg authored and jorgeluisrocha committed May 18, 2023
1 parent d76a191 commit a884c64
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ export const spec = {
'tk_flint',
'x_source.tid',
'l_pb_bid_id',
'x_source.pchain',
'p_screen_res',
'rp_floor',
'rp_secure',
Expand Down Expand Up @@ -466,7 +465,6 @@ export const spec = {
'tk_flint': `${rubiConf.int_type || DEFAULT_INTEGRATION}_v$prebid.version$`,
'x_source.tid': bidRequest.transactionId,
'l_pb_bid_id': bidRequest.bidId,
'x_source.pchain': params.pchain,
'p_screen_res': _getScreenResolution(),
'tk_user_key': params.userId,
'p_geo.latitude': isNaN(parseFloat(latitude)) ? undefined : parseFloat(latitude).toFixed(4),
Expand Down
13 changes: 1 addition & 12 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ describe('the rubicon adapter', function () {
accountId: '14062',
siteId: '70608',
zoneId: '335918',
pchain: 'GAM:11111-reseller1:22222',
userId: '12346',
keywords: ['a', 'b', 'c'],
inventory: {
Expand Down Expand Up @@ -430,7 +429,6 @@ describe('the rubicon adapter', function () {
'rand': '0.1',
'tk_flint': INTEGRATION,
'x_source.tid': 'd45dd707-a418-42ec-b8a7-b70a6c6fab0b',
'x_source.pchain': 'GAM:11111-reseller1:22222',
'p_screen_res': /\d+x\d+/,
'tk_user_key': '12346',
'kw': 'a,b,c',
Expand Down Expand Up @@ -598,20 +596,11 @@ describe('the rubicon adapter', function () {
expect(data['p_pos']).to.equal('atf;;btf;;');
});

it('should not send x_source.pchain to AE if params.pchain is not specified', function () {
var noPchainRequest = utils.deepClone(bidderRequest);
delete noPchainRequest.bids[0].params.pchain;

let [request] = spec.buildRequests(noPchainRequest.bids, noPchainRequest);
expect(request.data).to.contain('&site_id=70608&');
expect(request.data).to.not.contain('x_source.pchain');
});

it('ad engine query params should be ordered correctly', function () {
sandbox.stub(Math, 'random').callsFake(() => 0.1);
let [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);

const referenceOrdering = ['account_id', 'site_id', 'zone_id', 'size_id', 'alt_size_ids', 'p_pos', 'rf', 'p_geo.latitude', 'p_geo.longitude', 'kw', 'tg_v.ucat', 'tg_v.lastsearch', 'tg_v.likes', 'tg_i.rating', 'tg_i.prodtype', 'tk_flint', 'x_source.tid', 'l_pb_bid_id', 'x_source.pchain', 'p_screen_res', 'rp_secure', 'tk_user_key', 'tg_fl.eid', 'rp_maxbids', 'slots', 'rand'];
const referenceOrdering = ['account_id', 'site_id', 'zone_id', 'size_id', 'alt_size_ids', 'p_pos', 'rf', 'p_geo.latitude', 'p_geo.longitude', 'kw', 'tg_v.ucat', 'tg_v.lastsearch', 'tg_v.likes', 'tg_i.rating', 'tg_i.prodtype', 'tk_flint', 'x_source.tid', 'l_pb_bid_id', 'p_screen_res', 'rp_secure', 'tk_user_key', 'tg_fl.eid', 'rp_maxbids', 'slots', 'rand'];

request.data.split('&').forEach((item, i) => {
expect(item.split('=')[0]).to.equal(referenceOrdering[i]);
Expand Down

0 comments on commit a884c64

Please sign in to comment.