Skip to content

Commit

Permalink
Onetag Bid Adapter: add reading of addtlConsent GDPR field (#11202)
Browse files Browse the repository at this point in the history
Co-authored-by: federico <f.liccione@onetag.com>
  • Loading branch information
onetag-dev and fliccione authored Mar 13, 2024
1 parent 643cbd0 commit 6bd8ba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/onetagBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ function buildRequests(validBidRequests, bidderRequest) {
if (bidderRequest && bidderRequest.gdprConsent) {
payload.gdprConsent = {
consentString: bidderRequest.gdprConsent.consentString,
consentRequired: bidderRequest.gdprConsent.gdprApplies
consentRequired: bidderRequest.gdprConsent.gdprApplies,
addtlConsent: bidderRequest.gdprConsent.addtlConsent
};
}
if (bidderRequest && bidderRequest.gppConsent) {
Expand Down
5 changes: 4 additions & 1 deletion test/spec/modules/onetagBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,16 @@ describe('onetag', function () {
});
it('should send GDPR consent data', function () {
let consentString = 'consentString';
let addtlConsent = '2~1.35.41.101~dv.9.21.81';
let bidderRequest = {
'bidderCode': 'onetag',
'auctionId': '1d1a030790a475',
'bidderRequestId': '22edbae2733bf6',
'timeout': 3000,
'gdprConsent': {
consentString: consentString,
gdprApplies: true
gdprApplies: true,
addtlConsent: addtlConsent
}
};
let serverRequest = spec.buildRequests([bannerBid], bidderRequest);
Expand All @@ -289,6 +291,7 @@ describe('onetag', function () {
expect(payload).to.exist;
expect(payload.gdprConsent).to.exist;
expect(payload.gdprConsent.consentString).to.exist.and.to.equal(consentString);
expect(payload.gdprConsent.addtlConsent).to.exist.and.to.equal(addtlConsent);
expect(payload.gdprConsent.consentRequired).to.exist.and.to.be.true;
});
it('Should send GPP consent data', function () {
Expand Down

0 comments on commit 6bd8ba6

Please sign in to comment.