Skip to content

Commit

Permalink
Zeta Ssp Bid Adapter: vast xml for bid (#7740)
Browse files Browse the repository at this point in the history
* vastXml as bid.ad

* test added

* logic with ext.bidtype

* fix tests

* fix tests(3)

* change .md for video support sample

Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
  • Loading branch information
asurovenko-zeta and surovenko authored Nov 24, 2021
1 parent a1d2aa0 commit 820afe7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
34 changes: 33 additions & 1 deletion modules/zetaSspBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Maintainer: miakovlev@zetaglobal.com

Module that connects to Zeta's SSP

# Test Parameters
# Banner Ad Unit: For Publishers
```
var adUnits = [
{
Expand Down Expand Up @@ -40,3 +40,35 @@ Module that connects to Zeta's SSP
}
];
```

# Video Ad Unit: For Publishers
```
var adUnits = [
{
mediaTypes: {
video: {
playerSize: [640, 480],
context: 'outstream'
}
},
bids: [
{
bidder: 'zeta_global_ssp',
bidId: 12345,
params: {
placement: 12345,
user: {
uid: 12345,
buyeruid: 12345
},
tags: {
someTag: 123,
sid: 'publisherId'
},
test: 1
}
}
]
}
];
```
3 changes: 3 additions & 0 deletions modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export const spec = {
advertiserDomains: zetaBid.adomain
};
}
if (deepAccess(zetaBid, 'ext.bidtype', '') === VIDEO) {
bid.vastXml = bid.ad;
}
bidResponses.push(bid);
})
})
Expand Down
7 changes: 6 additions & 1 deletion test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ describe('Zeta Ssp Bid Adapter', function () {
'https://example2.com'
],
h: 150,
w: 200
w: 200,
ext: {
bidtype: 'video'
}
}
]
}
Expand All @@ -159,6 +162,7 @@ describe('Zeta Ssp Bid Adapter', function () {
const receivedBid1 = response.body.seatbid[0].bid[0];
expect(bid1).to.not.be.empty;
expect(bid1.ad).to.equal(receivedBid1.adm);
expect(bid1.vastXml).to.be.undefined;
expect(bid1.cpm).to.equal(receivedBid1.price);
expect(bid1.height).to.equal(receivedBid1.h);
expect(bid1.width).to.equal(receivedBid1.w);
Expand All @@ -169,6 +173,7 @@ describe('Zeta Ssp Bid Adapter', function () {
const receivedBid2 = response.body.seatbid[0].bid[1];
expect(bid2).to.not.be.empty;
expect(bid2.ad).to.equal(receivedBid2.adm);
expect(bid2.vastXml).to.equal(receivedBid2.adm);
expect(bid2.cpm).to.equal(receivedBid2.price);
expect(bid2.height).to.equal(receivedBid2.h);
expect(bid2.width).to.equal(receivedBid2.w);
Expand Down

0 comments on commit 820afe7

Please sign in to comment.