Skip to content

Commit

Permalink
GumGum Bid Adapter : send gpp data in bidrequest (#9707)
Browse files Browse the repository at this point in the history
* Add GPP support in the bid request

* Change parameter name from applicabaleSection to gpp_sid
  • Loading branch information
MartinGumGum authored Mar 24, 2023
1 parent 9ef8d25 commit a6ef0c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ function buildRequests(validBidRequests, bidderRequest) {
if (gppConsent) {
data.gppConsent = {
gppString: bidderRequest.gppConsent.gppString,
applicableSections: bidderRequest.gppConsent.applicableSections
gpp_sid: bidderRequest.gppConsent.applicableSections
}
} else if (!gppConsent && bidderRequest?.ortb2?.regs?.gpp) {
data.gppConsent = {
gppString: bidderRequest.ortb2.regs.gpp,
applicableSections: bidderRequest.ortb2.regs.gpp_sid
gpp_sid: bidderRequest.ortb2.regs.gpp_sid
};
}
if (coppa) {
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ describe('gumgumAdapter', function () {
const bidRequest = spec.buildRequests(bidRequests, fakeBidRequest)[0];
expect(bidRequest.data.gppConsent).to.exist;
expect(bidRequest.data.gppConsent.gppString).to.equal(gppConsent.gppString);
expect(bidRequest.data.gppConsent.applicableSections).to.equal(gppConsent.applicableSections);
expect(bidRequest.data.gppConsent.gpp_sid).to.equal(gppConsent.applicableSections);
expect(bidRequest.data.gppConsent.gppString).to.eq('DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN');
});
it('should handle ortb2 parameters', function () {
Expand All @@ -511,7 +511,7 @@ describe('gumgumAdapter', function () {
const bidRequest = spec.buildRequests(bidRequests, fakeBidRequest)[0];
expect(bidRequest.data.gppConsent).to.exist;
expect(bidRequest.data.gppConsent.gppString).to.equal(undefined);
expect(bidRequest.data.gppConsent.applicableSections).to.equal(undefined);
expect(bidRequest.data.gppConsent.gpp_sid).to.equal(undefined);
});
it('should handle ortb2 undefined parameters', function () {
const ortb2 = {
Expand All @@ -523,7 +523,7 @@ describe('gumgumAdapter', function () {
const fakeBidRequest = { gppConsent: ortb2 };
const bidRequest = spec.buildRequests(bidRequests, fakeBidRequest)[0];
expect(bidRequest.data.gppConsent.gppString).to.eq(undefined)
expect(bidRequest.data.gppConsent.applicableSections).to.eq(undefined)
expect(bidRequest.data.gppConsent.gpp_sid).to.eq(undefined)
});
it('should not set coppa parameter if coppa config is set to false', function () {
config.setConfig({
Expand Down

0 comments on commit a6ef0c0

Please sign in to comment.