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

Seedtag Bid Adapter : allows sending bcat and badv ortb2 params in request payload #11490

Merged
merged 2 commits into from
May 15, 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
8 changes: 8 additions & 0 deletions modules/seedtagBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ export const spec = {
payload.user.eids = validBidRequests[0].userIdAsEids
}

if (bidderRequest.ortb2?.bcat) {
payload.bcat = bidderRequest.ortb2?.bcat
}

if (bidderRequest.ortb2?.badv) {
payload.badv = bidderRequest.ortb2?.badv
}

const payloadString = JSON.stringify(payload);

return {
Expand Down
36 changes: 36 additions & 0 deletions test/spec/modules/seedtagBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,42 @@ describe('Seedtag Adapter', function () {
expect(data.user.eids).to.deep.equal(userIdAsEids);
})
});

describe('Blocking params', function () {
it('should add bcat param to payload when bidderRequest has ortb2 bcat info', function () {
const blockedCategories = ['IAB1', 'IAB2']
var ortb2 = {
bcat: blockedCategories
}
bidderRequest['ortb2'] = ortb2

const request = spec.buildRequests(validBidRequests, bidderRequest);
const data = JSON.parse(request.data);
expect(data.bcat).to.deep.equal(blockedCategories);
});

it('should add badv param to payload when bidderRequest has ortb2 badv info', function () {
const blockedAdvertisers = ['blocked.com']
var ortb2 = {
badv: blockedAdvertisers
}
bidderRequest['ortb2'] = ortb2

const request = spec.buildRequests(validBidRequests, bidderRequest);
const data = JSON.parse(request.data);
expect(data.badv).to.deep.equal(blockedAdvertisers);
});

it('should not add bcat and badv params to payload when bidderRequest does not have ortb2 badv and bcat info', function () {
var ortb2 = {}
bidderRequest['ortb2'] = ortb2

const request = spec.buildRequests(validBidRequests, bidderRequest);
const data = JSON.parse(request.data);
expect(data.bcat).to.be.undefined;
expect(data.badv).to.be.undefined;
});
});
})
describe('interpret response method', function () {
it('should return a void array, when the server response are not correct.', function () {
Expand Down