Skip to content

Commit

Permalink
Merge pull request #4 from gumgum/ADJS-1165-prebid-adaptor-changes-to…
Browse files Browse the repository at this point in the history
…-support-jp-products

ADJS-1165-prebid-adaptor-changes-to-support-jp-products
  • Loading branch information
john-ivan authored Jun 9, 2022
2 parents 7d3768a + 941429e commit b5fd2d6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ function buildRequests(validBidRequests, bidderRequest) {
data.pi = 5;
} else if (mediaTypes.video) {
data.pi = mediaTypes.video.linearity === 2 ? 6 : 7; // invideo : video
} else if (params.product && params.product.toLowerCase() === 'skin') {
data.pi = 8;
}
} else { // legacy params
data = { ...data, ...handleLegacyParams(params, sizes) }
Expand Down
20 changes: 19 additions & 1 deletion modules/gumgumBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Maintainer: engineering@gumgum.com

GumGum adapter for Prebid.js
Please note that both video and in-video products require a mediaType of video.
In-screen and slot products should have a mediaType of banner.
In-screen, slot, and skin products should have a mediaType of banner.

# Test Parameters
```
Expand Down Expand Up @@ -50,6 +50,24 @@ var adUnits = [
}
}
]
},{
code: 'skin-placement',
sizes: [[300, 50]],
mediaTypes: {
banner: {
sizes: [[1, 1]],
}
},
bids: [
{
bidder: 'gumgum',
params: {
zone: 'dc9d6be1', // GumGum Zone ID given to the client
product: 'skin',
bidfloor: 0.03 // CPM bid floor
}
}
]
},{
code: 'video-placement',
sizes: [[300, 50]],
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ describe('gumgumAdapter', function () {
const bidRequest = spec.buildRequests([request])[0];
expect(bidRequest.data.pi).to.equal(3);
});
it('should set the correct pi param if product param is found and is equal to skin', function () {
const request = { ...bidRequests[0], params: { ...zoneParam, product: 'Skin' } };
const bidRequest = spec.buildRequests([request])[0];
expect(bidRequest.data.pi).to.equal(8);
});
it('should default the pi param to 2 if only zone or pubId param is found', function () {
const zoneRequest = { ...bidRequests[0], params: zoneParam };
const pubIdRequest = { ...bidRequests[0], params: pubIdParam };
Expand Down

0 comments on commit b5fd2d6

Please sign in to comment.