Skip to content

Commit

Permalink
Improve Digital Bid Adapter : remove parsing of addtlConsent (prebid#…
Browse files Browse the repository at this point in the history
…11514)

* Remove parsing of addtlConsent

* Fix test
  • Loading branch information
jbartek25 authored and mefjush committed May 21, 2024
1 parent e43821b commit 003675f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
23 changes: 0 additions & 23 deletions modules/improvedigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,29 +237,6 @@ export const CONVERTER = ortbConverter({
imp.video.placement = VIDEO_PARAMS.PLACEMENT_TYPE.OUTSTREAM;
}
}
},
request: {
gdprAddtlConsent(setAddtlConsent, ortbRequest, bidderRequest) {
const additionalConsent = bidderRequest?.gdprConsent?.addtlConsent;
if (!additionalConsent) {
return;
}
if (spec.syncStore.extendMode) {
setAddtlConsent(ortbRequest, bidderRequest);
return;
}
if (additionalConsent && additionalConsent.indexOf('~') !== -1) {
// Google Ad Tech Provider IDs
const atpIds = additionalConsent.substring(additionalConsent.indexOf('~') + 1);
if (atpIds) {
deepSetValue(
ortbRequest,
'user.ext.consented_providers_settings.consented_providers',
atpIds.split('.').map(id => parseInt(id, 10))
);
}
}
}
}
}
})
Expand Down
3 changes: 1 addition & 2 deletions test/spec/modules/improvedigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ describe('Improve Digital Adapter Tests', function () {
const payload = JSON.parse(spec.buildRequests([bidRequest], syncAddFPDToBidderRequest(bidderRequestGdpr))[0].data);
expect(payload.regs.ext.gdpr).to.exist.and.to.equal(1);
expect(payload.user.ext.consent).to.equal('CONSENT');
expect(payload.user.ext.ConsentedProvidersSettings).to.not.exist;
expect(payload.user.ext.consented_providers_settings.consented_providers).to.exist.and.to.deep.equal([1, 35, 41, 101]);
expect(payload.user.ext.ConsentedProvidersSettings.consented_providers).to.exist.and.to.deep.equal('1~1.35.41.101');
});

it('should not add consented providers when empty', function () {
Expand Down

0 comments on commit 003675f

Please sign in to comment.