Skip to content

Commit

Permalink
Rubicon Bid Adapter : send Fastlane cdep flag (#10703)
Browse files Browse the repository at this point in the history
* Initial change

* Add cdep unit test
  • Loading branch information
spotxslagle authored Nov 8, 2023
1 parent 9595899 commit ea5bc2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ export const spec = {
'l_pb_bid_id',
'p_screen_res',
'o_ae',
'o_cdep',
'rp_floor',
'rp_secure',
'tk_user_key'
Expand Down Expand Up @@ -482,6 +483,7 @@ export const spec = {
'x_source.tid': bidderRequest.ortb2?.source?.tid,
'x_imp.ext.tid': bidRequest.ortb2Imp?.ext?.tid,
'l_pb_bid_id': bidRequest.bidId,
'o_cdep': bidRequest.ortb2?.device?.ext?.cdep,
'p_screen_res': _getScreenResolution(),
'tk_user_key': params.userId,
'p_geo.latitude': isNaN(parseFloat(latitude)) ? undefined : parseFloat(latitude).toFixed(4),
Expand Down
10 changes: 10 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,16 @@ describe('the rubicon adapter', function () {
expect(data['p_pos']).to.equal('atf;;btf;;');
});

it('should correctly send cdep signal when requested', () => {
var badposRequest = utils.deepClone(bidderRequest);
badposRequest.bids[0].ortb2 = {device: {ext: {cdep: 3}}};

let [request] = spec.buildRequests(badposRequest.bids, badposRequest);
let data = parseQuery(request.data);

expect(data['o_cdep']).to.equal('3');
});

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

0 comments on commit ea5bc2c

Please sign in to comment.