diff --git a/modules/improvedigitalBidAdapter.js b/modules/improvedigitalBidAdapter.js index 688a8815e93..2c96d0540ee 100644 --- a/modules/improvedigitalBidAdapter.js +++ b/modules/improvedigitalBidAdapter.js @@ -11,7 +11,7 @@ const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js const VIDEO_TARGETING = ['skip', 'skipmin', 'skipafter']; export const spec = { - version: '7.4.0', + version: '7.5.0', code: BIDDER_CODE, gvlid: 253, aliases: ['id'], @@ -45,8 +45,24 @@ export const spec = { libVersion: this.version }; - if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString) { - requestParameters.gdpr = bidderRequest.gdprConsent.consentString; + const gdprConsent = deepAccess(bidderRequest, 'gdprConsent') + if (gdprConsent) { + // GDPR Consent String + if (gdprConsent.consentString) { + requestParameters.gdpr = gdprConsent.consentString; + } + + // Additional Consent String + const additionalConsent = deepAccess(gdprConsent, 'addtlConsent'); + if (additionalConsent && additionalConsent.indexOf('~') !== -1) { + // Google Ad Tech Provider IDs + const atpIds = additionalConsent.substring(additionalConsent.indexOf('~') + 1); + deepSetValue( + requestParameters, + 'user.ext.consented_providers_settings.consented_providers', + atpIds.split('.').map(id => parseInt(id, 10)) + ); + } } if (bidderRequest && bidderRequest.uspConsent) { diff --git a/test/spec/modules/improvedigitalBidAdapter_spec.js b/test/spec/modules/improvedigitalBidAdapter_spec.js index 095e50f0c66..3aa2ab8e873 100644 --- a/test/spec/modules/improvedigitalBidAdapter_spec.js +++ b/test/spec/modules/improvedigitalBidAdapter_spec.js @@ -92,7 +92,8 @@ describe('Improve Digital Adapter Tests', function () { gdprConsent: { consentString: 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==', vendorData: {}, - gdprApplies: true + gdprApplies: true, + addtlConsent: '1~1.35.41.101', }, }; @@ -278,6 +279,7 @@ describe('Improve Digital Adapter Tests', function () { const request = spec.buildRequests([bidRequest], bidderRequestGdpr)[0]; const params = JSON.parse(decodeURIComponent(request.data.substring(PARAM_PREFIX.length))); expect(params.bid_request.gdpr).to.equal('BOJ/P2HOJ/P2HABABMAAAAAZ+A=='); + expect(params.bid_request.user.ext.consented_providers_settings.consented_providers).to.exist.and.to.deep.equal([1, 35, 41, 101]); }); it('should add CCPA consent string', function () {