Skip to content

Commit

Permalink
Added GPP support (prebid#10094)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <ubuntu@ip-172-31-25-92.us-west-1.compute.internal>
  • Loading branch information
2 people authored and Michele Nasti committed Aug 25, 2023
1 parent b0256f0 commit ff2cedc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions modules/vrtcalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ export const spec = {
params.imp[0].banner.h = bid.sizes[0][1];
}

if (bid.ortb2?.regs?.gpp) {
params.regs.ext.gpp = bid.ortb2.regs.gpp;
params.regs.ext.gpp_sid = bid.ortb2.regs.gpp_sid;
}

return {method: 'POST', url: 'https://rtb.vrtcal.com/bidder_prebid.vap?ssp=1804', data: JSON.stringify(params), options: {withCredentials: false, crossOrigin: true}};
});

Expand Down
11 changes: 9 additions & 2 deletions test/spec/modules/vrtcalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,21 @@ describe('vrtcalBidAdapter', function () {
expect(request[0].data).to.match(/"bidfloor":0.55/);
});

it('pass GDPR,CCPA, and COPPA indicators/consent strings with the request when present', function () {
it('pass GDPR,CCPA,COPPA, and GPP indicators/consent strings with the request when present', function () {
bidRequests[0].gdprConsent = {consentString: 'gdpr-consent-string', gdprApplies: true};
bidRequests[0].uspConsent = 'ccpa-consent-string';
config.setConfig({ coppa: false });

bidRequests[0].ortb2 = {
regs: {
gpp: 'testGpp',
gpp_sid: [1, 2, 3]
}
}

request = spec.buildRequests(bidRequests);
expect(request[0].data).to.match(/"user":{"ext":{"consent":"gdpr-consent-string"/);
expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string"}}/);
expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string","gpp":"testGpp","gpp_sid":\[1,2,3\]}}/);
});

it('pass bidder timeout/tmax with the request', function () {
Expand Down

0 comments on commit ff2cedc

Please sign in to comment.