Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StroeerCoreBidAdapter: passes userIdAsEids to the server #18

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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