Skip to content

Commit

Permalink
ZetaGlobalSsp Bid Adapter: provide dspId into bid (#11150)
Browse files Browse the repository at this point in the history
Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
Co-authored-by: Alexey Surovenko <ASurovenko@vdhk6ddf9m.home>
  • Loading branch information
3 people authored Feb 28, 2024
1 parent 37d368e commit 6669609
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export const spec = {
const response = (serverResponse || {}).body;
if (response && response.seatbid && response.seatbid[0].bid && response.seatbid[0].bid.length) {
response.seatbid.forEach(zetaSeatbid => {
const seat = zetaSeatbid.seat;
zetaSeatbid.bid.forEach(zetaBid => {
let bid = {
requestId: zetaBid.impid,
Expand All @@ -223,6 +224,9 @@ export const spec = {
if (bid.mediaType === VIDEO) {
bid.vastXml = bid.ad;
}
if (seat) {
bid.dspId = seat;
}
bidResponses.push(bid);
})
})
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ describe('Zeta Ssp Bid Adapter', function () {
id: '12345',
seatbid: [
{
seat: '1',
bid: [
{
id: 'auctionId',
Expand Down Expand Up @@ -601,6 +602,7 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(bidResponse[0].mediaType).to.eql(BANNER);
expect(bidResponse[0].ad).to.eql(zetaResponse.body.seatbid[0].bid[0].adm);
expect(bidResponse[0].vastXml).to.be.undefined;
expect(bidResponse[0].dspId).to.eql(zetaResponse.body.seatbid[0].seat);
});

it('Test the response default mediaType:video', function () {
Expand All @@ -610,6 +612,7 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(bidResponse[0].mediaType).to.eql(VIDEO);
expect(bidResponse[0].ad).to.eql(zetaResponse.body.seatbid[0].bid[0].adm);
expect(bidResponse[0].vastXml).to.eql(zetaResponse.body.seatbid[0].bid[0].adm);
expect(bidResponse[0].dspId).to.eql(zetaResponse.body.seatbid[0].seat);
});

it('Test the response mediaType:video from ext param', function () {
Expand All @@ -624,6 +627,7 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(bidResponse[0].mediaType).to.eql(VIDEO);
expect(bidResponse[0].ad).to.eql(zetaResponse.body.seatbid[0].bid[0].adm);
expect(bidResponse[0].vastXml).to.eql(zetaResponse.body.seatbid[0].bid[0].adm);
expect(bidResponse[0].dspId).to.eql(zetaResponse.body.seatbid[0].seat);
});

it('Test the response mediaType:banner from ext param', function () {
Expand All @@ -638,6 +642,7 @@ describe('Zeta Ssp Bid Adapter', function () {
expect(bidResponse[0].mediaType).to.eql(BANNER);
expect(bidResponse[0].ad).to.eql(zetaResponse.body.seatbid[0].bid[0].adm);
expect(bidResponse[0].vastXml).to.be.undefined;
expect(bidResponse[0].dspId).to.eql(zetaResponse.body.seatbid[0].seat);
});

it('Test provide segments into the request', function () {
Expand Down

0 comments on commit 6669609

Please sign in to comment.