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

Adnuntius Bidder: Added option to pass a user id through ortb2. #7639

Merged
merged 1 commit into from
Nov 15, 2021
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
3 changes: 2 additions & 1 deletion modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const handleMeta = function () {
}

const getUsi = function (meta, ortb2, bidderRequest) {
const usi = (meta !== null) ? meta.usi : false;
let usi = (meta !== null && meta.usi) ? meta.usi : false;
if (ortb2 && ortb2.user && ortb2.user.id) { usi = ortb2.user.id }
return usi
}

Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/adnuntiusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,24 @@ describe('adnuntiusBidAdapter', function () {
expect(request[0]).to.have.property('url')
expect(request[0].url).to.equal(ENDPOINT_URL_SEGMENTS);
});

it('should user user ID if present in ortb2.user.id field', function () {
config.setBidderConfig({
bidders: ['adnuntius', 'other'],
config: {
ortb2: {
user: {
id: usi
}
}
}
});

const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidRequests));
expect(request.length).to.equal(1);
expect(request[0]).to.have.property('url')
expect(request[0].url).to.equal(ENDPOINT_URL);
});
});

describe('user privacy', function () {
Expand Down