Skip to content

Commit

Permalink
Boldwin Adapter: gpp support (#10370)
Browse files Browse the repository at this point in the history
* new boldwin bid adapter

* fix

* Restarting ci / circleci

* changes

* fixed conflicts

* added endpointId param

* kick off CircleCI tests

* gpp

---------

Co-authored-by: Aiholkin <[email protected]>
Co-authored-by: Vladislav Isaiko <[email protected]>
Co-authored-by: Mykhailo Yaremchuk <[email protected]>
Co-authored-by: Chris Huie <[email protected]>
  • Loading branch information
5 people committed Sep 6, 2023
1 parent ceccd88 commit f858437
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
9 changes: 9 additions & 0 deletions modules/boldwinBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ export const spec = {
if (bidderRequest.gdprConsent) {
request.gdpr = bidderRequest.gdprConsent;
}

// Add GPP consent
if (bidderRequest.gppConsent) {
request.gpp = bidderRequest.gppConsent.gppString;
request.gpp_sid = bidderRequest.gppConsent.applicableSections;
} else if (bidderRequest.ortb2?.regs?.gpp) {
request.gpp = bidderRequest.ortb2.regs.gpp;
request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
}
}
const len = validBidRequests.length;

Expand Down
33 changes: 32 additions & 1 deletion test/spec/modules/boldwinBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ describe('BoldwinBidAdapter', function () {
const bidderRequest = {
refererInfo: {
referer: 'test.com'
}
},
ortb2: {}
};

describe('isBidRequestValid', function () {
Expand Down Expand Up @@ -110,6 +111,36 @@ describe('BoldwinBidAdapter', function () {
expect(data.placements).to.be.an('array').that.is.empty;
});
});

describe('gpp consent', function () {
it('bidderRequest.gppConsent', () => {
bidderRequest.gppConsent = {
gppString: 'abc123',
applicableSections: [8]
};

let serverRequest = spec.buildRequests([bid], bidderRequest);
let data = serverRequest.data;
expect(data).to.be.an('object');
expect(data).to.have.property('gpp');
expect(data).to.have.property('gpp_sid');

delete bidderRequest.gppConsent;
})

it('bidderRequest.ortb2.regs.gpp', () => {
bidderRequest.ortb2.regs = bidderRequest.ortb2.regs || {};
bidderRequest.ortb2.regs.gpp = 'abc123';
bidderRequest.ortb2.regs.gpp_sid = [8];

let serverRequest = spec.buildRequests([bid], bidderRequest);
let data = serverRequest.data;
expect(data).to.be.an('object');
expect(data).to.have.property('gpp');
expect(data).to.have.property('gpp_sid');
})
});

describe('interpretResponse', function () {
it('Should interpret banner response', function () {
const banner = {
Expand Down

0 comments on commit f858437

Please sign in to comment.