Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADJS-1165-prebid-adaptor-changes-to-support-jp-products #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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