Skip to content

Commit

Permalink
Rubicon bid adapter: Support rtipartner and rtiPartner
Browse files Browse the repository at this point in the history
  • Loading branch information
apukh-magnite committed Jan 23, 2025
1 parent e5da6c8 commit 1acd846
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export const spec = {
inserter || '',
matcher || '',
mm || '',
uidData?.ext?.rtipartner || ''
uidData?.ext?.rtiPartner || uidData?.ext?.rtipartner || ''
].join('^'); // Return a single string formatted with '^' delimiter

const eidValue = buildEidValue(uidData); // Build the EID value string
Expand Down
33 changes: 33 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,39 @@ describe('the rubicon adapter', function () {
// Expected format: uid^atype^third^inserter^matcher^mm^rtipartner
const expectedEidValue = '11111^2^^inserter123^matcher123^mm123^rtipartner123';

// Check if the generated EID value matches the expected format
expect(data.get('eid_example.com')).to.equal(expectedEidValue);
});
it('should generate eidValue with all attributes including rtiPartner', function () {
const clonedBid = utils.deepClone(bidderRequest.bids[0]);
// Simulating a full EID object with multiple fields
clonedBid.ortb2 = {
user: {
ext: {
eids: [{
source: 'example.com',
uids: [{
id: '11111', // UID
atype: 2, // atype
ext: {
rtiPartner: 'rtipartner123', // rtiPartner (note the different capitalization)
stype: 'ppuid' // stype
}
}],
inserter: 'inserter123', // inserter
matcher: 'matcher123', // matcher
mm: 'mm123' // mm
}]
}
}
};

let [request] = spec.buildRequests([clonedBid], bidderRequest);
let data = new URLSearchParams(request.data);

// Expected format: uid^atype^third^inserter^matcher^mm^rtipartner
const expectedEidValue = '11111^2^^inserter123^matcher123^mm123^rtipartner123';

// Check if the generated EID value matches the expected format
expect(data.get('eid_example.com')).to.equal(expectedEidValue);
});
Expand Down

0 comments on commit 1acd846

Please sign in to comment.