Skip to content

Commit

Permalink
Merge pull request #18 from mbrtargeting/IDE-EidInOrtb
Browse files Browse the repository at this point in the history
StroeerCoreBidAdapter: passes userIdAsEids to the server
  • Loading branch information
tonytian authored Sep 17, 2024
2 parents 93c6b94 + aee9fdb commit 9f55dea
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/stroeerCoreBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export const spec = {

const user = utils.cleanObj({
euids: anyBid.userId,
eids: bidderRequest.userIdAsEids,
data: utils.deepAccess(bidderRequest, 'ortb2.user.data')
});

Expand Down
28 changes: 27 additions & 1 deletion test/spec/modules/stroeerCoreBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ describe('stroeerCore bid adapter', function() {
}
});

// Pub Provided ids
const userIdAsEids = Object.freeze([
{
source: 'stroeer.de',
uids: [
{
id: 'db1747db-a0c6-42e7-9387-ace49d2f80b7',
atype: 1,
ext: {
stype: 'ppuid'
}
}
]
}
])

const buildBidderRequest = () => ({
bidderRequestId: 'bidder-request-id-123',
bidderCode: 'stroeerCore',
Expand All @@ -94,6 +110,7 @@ describe('stroeerCore bid adapter', function() {
page: 'https://www.example.com/monkey/index.html',
ref: 'https://www.example.com/?search=monkey'
},
userIdAsEids: userIdAsEids,
bids: [{
bidId: 'bid1',
bidder: 'stroeerCore',
Expand Down Expand Up @@ -568,6 +585,7 @@ describe('stroeerCore bid adapter', function() {
}],
'ver': {},
'user': {
'eids': userIdAsEids,
'euids': userIds
}
};
Expand Down Expand Up @@ -1018,7 +1036,15 @@ describe('stroeerCore bid adapter', function() {
bidReq.bids.forEach(bid => delete bid.userId);
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq)[0];
assert.lengthOf(serverRequestInfo.data.bids, 2);
assert.notProperty(serverRequestInfo, 'uids');
assert.notProperty(serverRequestInfo.data.user, 'euids');
});

it('should be able to build without userIdAsEids', () => {
const bidReq = buildBidderRequest();
bidReq.userIdAsEids = undefined
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq)[0];
assert.lengthOf(serverRequestInfo.data.bids, 2);
assert.notProperty(serverRequestInfo.data.user, 'eids');
});

it('should add schain if available', () => {
Expand Down

0 comments on commit 9f55dea

Please sign in to comment.