Skip to content

Commit

Permalink
Rubicon Bid Adapter: Format rubicon EID (#10409)
Browse files Browse the repository at this point in the history
* drop atype for rubicon eid

* i spell bad
  • Loading branch information
robertrmartinez committed Aug 30, 2023
1 parent 5ef3a17 commit 7709898
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,9 @@ export const spec = {
data['eid_id5-sync.com'] = `${eid.uids[0].id}^${eid.uids[0].atype}^${(eid.uids[0].ext && eid.uids[0].ext.linkType) || ''}`;
} else {
// add anything else with this generic format
data[`eid_${eid.source}`] = `${eid.uids[0].id}^${eid.uids[0].atype || ''}`;
// if rubicon drop ^
const id = eid.source === 'rubiconproject.com' ? eid.uids[0].id : `${eid.uids[0].id}^${eid.uids[0].atype || ''}`
data[`eid_${eid.source}`] = id;
}
// send AE "ppuid" signal if exists, and hasn't already been sent
if (!data['ppuid']) {
Expand Down
16 changes: 16 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,22 @@ describe('the rubicon adapter', function () {

expect(data['eid_catchall']).to.equal('11111^2');
});

it('should send rubiconproject special case', function () {
const clonedBid = utils.deepClone(bidderRequest.bids[0]);
// Hardcoding userIdAsEids since createEidsArray returns empty array if source not found in eids.js
clonedBid.userIdAsEids = [{
source: 'rubiconproject.com',
uids: [{
id: 'some-cool-id',
atype: 3
}]
}]
let [request] = spec.buildRequests([clonedBid], bidderRequest);
let data = parseQuery(request.data);

expect(data['eid_rubiconproject.com']).to.equal('some-cool-id');
});
});

describe('Config user.id support', function () {
Expand Down

0 comments on commit 7709898

Please sign in to comment.