Skip to content

Commit

Permalink
PubMatic adding a targeting key for buyid (#5171)
Browse files Browse the repository at this point in the history
* added support for pubcommon, digitrust, id5id

* added support for IdentityLink

* changed the source for id5

* added unit test cases

* changed source param for identityLink

* PubMatic sets bid.adserverTargeting.hb_buyid_pubmatic

* documentation note about bid.adserverTargeting.hb_buyid_pubmatic

* expect buyid to be in seatbid.ext.buyid
  • Loading branch information
pm-harshad-mane authored Apr 27, 2020
1 parent a883653 commit 2621343
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,13 @@ export const spec = {
newBid.meta.clickUrl = bid.adomain[0];
}

// adserverTargeting
if (seatbidder.ext && seatbidder.ext.buyid) {
newBid.adserverTargeting = {
'hb_buyid_pubmatic': seatbidder.ext.buyid
};
}

bidResponses.push(newBid);
});
});
Expand Down
4 changes: 3 additions & 1 deletion modules/pubmaticBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,7 @@ pbjs.setConfig({
```
Note: Combine the above the configuration with any other UserSync configuration. Multiple setConfig() calls overwrite each other and only last call for a given attribute will take effect.

Note: PubMatic will return a test-bid if "pubmaticTest=true" is present in page URL
# Notes:
- PubMatic will return a test-bid if "pubmaticTest=true" is present in page URL
- PubMatic will set bid.adserverTargeting.hb_buyid_pubmatic targeting key while submitting a bid into Prebid

8 changes: 8 additions & 0 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,9 @@ describe('PubMatic adapter', function () {
'id': '93D3BAD6-E2E2-49FB-9D89-920B1761C865',
'seatbid': [{
'seat': 'seat-id',
'ext': {
'buyid': 'BUYER-ID-987'
},
'bid': [{
'id': '74858439-49D7-4169-BA5D-44A046315B2F',
'impid': '22bddb28db77d',
Expand All @@ -549,6 +552,9 @@ describe('PubMatic adapter', function () {
}
}]
}, {
'ext': {
'buyid': 'BUYER-ID-789'
},
'bid': [{
'id': '74858439-49D7-4169-BA5D-44A046315BEF',
'impid': '22bddb28db77e',
Expand Down Expand Up @@ -2622,6 +2628,7 @@ describe('PubMatic adapter', function () {
expect(response[0].netRevenue).to.equal(false);
expect(response[0].ttl).to.equal(300);
expect(response[0].meta.networkId).to.equal(123);
expect(response[0].adserverTargeting.hb_buyid_pubmatic).to.equal('BUYER-ID-987');
expect(response[0].meta.buyerId).to.equal(976);
expect(response[0].meta.clickUrl).to.equal('blackrock.com');
expect(response[0].referrer).to.include(data.site.ref);
Expand All @@ -2643,6 +2650,7 @@ describe('PubMatic adapter', function () {
expect(response[1].netRevenue).to.equal(false);
expect(response[1].ttl).to.equal(300);
expect(response[1].meta.networkId).to.equal(422);
expect(response[1].adserverTargeting.hb_buyid_pubmatic).to.equal('BUYER-ID-789');
expect(response[1].meta.buyerId).to.equal(832);
expect(response[1].meta.clickUrl).to.equal('hivehome.com');
expect(response[1].referrer).to.include(data.site.ref);
Expand Down

0 comments on commit 2621343

Please sign in to comment.