Skip to content

Commit

Permalink
GumGum Bid Adapter : Add support for the DSA (prebid#11311)
Browse files Browse the repository at this point in the history
* Fix for the multi-size in- slot

* added comment

* displaymanager: add field for displaymanager and displaymanagerver

* fix: displayManager to include 'gumgum'

* fix: test case

* Add support for DSA in the bid request

---------

Co-authored-by: ahzgg <abel.herrera@gumgum.com>
Co-authored-by: ahzgg <163184035+ahzgg@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 10, 2024
1 parent de42f8d commit 7dbcb47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ function buildRequests(validBidRequests, bidderRequest) {
data.gppString = bidderRequest.ortb2.regs.gpp
data.gppSid = Array.isArray(bidderRequest.ortb2.regs.gpp_sid) ? bidderRequest.ortb2.regs.gpp_sid.join(',') : ''
}
const dsa = deepAccess(bidderRequest, 'ortb2.regs.ext.dsa');
if (dsa) {
data.dsa = dsa
}
if (coppa) {
data.coppa = coppa;
}
Expand Down Expand Up @@ -549,7 +553,6 @@ function interpretResponse(serverResponse, bidRequest) {
mediaType: type || mediaType
};
let sizes = parseSizesInput(bidRequest.sizes);

if (maxw && maxh) {
sizes = [`${maxw}x${maxh}`];
} else if (product === 5 && includes(sizes, '1x1')) {
Expand Down
23 changes: 23 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,29 @@ describe('gumgumAdapter', function () {
expect(bidRequest.data.gppString).to.eq('')
expect(bidRequest.data.gppSid).to.eq('')
});
it('should add DSA information to payload if available', function () {
// Define the sample ORTB2 object with DSA information
const ortb2 = {
regs: {
ext: {
dsa: {
dsarequired: '1',
pubrender: '2',
datatopub: '3',
transparency: [{
domain: 'test.com',
dsaparams: [1, 2, 3]
}]
}
}
}
};
const fakeBidRequest = { ortb2 };
// Call the buildRequests function to generate the bid request
const [bidRequest] = spec.buildRequests(bidRequests, fakeBidRequest);
// Assert that the DSA information in the bid request matches the provided ORTB2 data
expect(bidRequest.data.dsa).to.deep.equal(fakeBidRequest.ortb2.regs.ext.dsa);
});
it('should not set coppa parameter if coppa config is set to false', function () {
config.setConfig({
coppa: false
Expand Down

0 comments on commit 7dbcb47

Please sign in to comment.