Skip to content

Commit

Permalink
Merge pull request #387 from PubMatic-OpenWrap/groupMChanges
Browse files Browse the repository at this point in the history
Pull changes for dspid and seatid from prebid master
  • Loading branch information
pm-shashank-jain authored Apr 10, 2020
2 parents a784aa1 + 10ea6b3 commit 4ca81ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,8 @@ export const spec = {
br.ttl = 300;
br.referrer = parsedReferrer;
br.ad = bid.adm;
br.pm_seat = seatbidder.seat || null;
br.pm_dspid = bid.ext && bid.ext.dspid ? bid.ext.dspid : null
if (requestData.imp && requestData.imp.length > 0) {
requestData.imp.forEach(req => {
if (bid.impid === req.id) {
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ describe('PubMatic adapter', function () {
bidRequests = [firstBid, secoundBid];

firstResponse = {
'seat': 'seat-id',
'bid': [{
'id': '74858439-49D7-4169-BA5D-44A046315B2F',
'impid': '23acc48ad47af5',
Expand Down Expand Up @@ -2589,6 +2590,8 @@ describe('PubMatic adapter', function () {
expect(response[0].meta.clickUrl).to.equal('blackrock.com');
expect(response[0].referrer).to.include(data.site.ref);
expect(response[0].ad).to.equal(bidResponses.body.seatbid[0].bid[0].adm);
expect(response[0].pm_seat).to.equal(bidResponses.body.seatbid[0].seat);
expect(response[0].pm_dspid).to.equal(bidResponses.body.seatbid[0].bid[0].ext.dspid);

expect(response[1].requestId).to.equal(bidResponses.body.seatbid[1].bid[0].impid);
expect(response[1].cpm).to.equal((bidResponses.body.seatbid[1].bid[0].price).toFixed(2));
Expand All @@ -2608,6 +2611,8 @@ describe('PubMatic adapter', function () {
expect(response[1].meta.clickUrl).to.equal('hivehome.com');
expect(response[1].referrer).to.include(data.site.ref);
expect(response[1].ad).to.equal(bidResponses.body.seatbid[1].bid[0].adm);
expect(response[1].pm_seat).to.equal(bidResponses.body.seatbid[1].seat || null);
expect(response[1].pm_dspid).to.equal(bidResponses.body.seatbid[1].bid[0].ext.dspid);
});

it('should check for dealChannel value selection', function () {
Expand Down

0 comments on commit 4ca81ef

Please sign in to comment.