From 1e69b56a455d4cedc6b991ffb1d9d4869fb7b466 Mon Sep 17 00:00:00 2001 From: "shahin.rahbariasl" Date: Mon, 6 Mar 2023 18:35:32 -0500 Subject: [PATCH 1/2] feat: update additional consent location [PB-351] --- modules/ixBidAdapter.js | 4 +--- test/spec/modules/ixBidAdapter_spec.js | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 360a373ba9a..6909f876a90 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -832,9 +832,7 @@ function applyRegulations(r, bidderRequest) { }; if (gdprConsent.hasOwnProperty('addtlConsent') && gdprConsent.addtlConsent) { - r.user.ext.consented_providers_settings = { - consented_providers: gdprConsent.addtlConsent - }; + r.user.ext.addtl_consent = gdprConsent.addtlConsent } } } diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 5f104dce13f..e5e580159b8 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -3469,7 +3469,7 @@ describe('IndexexchangeAdapter', function () { expect(requestWithConsent.regs.ext.us_privacy).to.equal('1YYN'); }); - it('should contain `consented_providers_settings.consented_providers` & consent on user.ext when both are provided', function () { + it('should contain `user.ext.addtl_consent` & consent on user.ext when both are provided', function () { const options = { gdprConsent: { consentString: '3huaa11=qu3198ae', @@ -3479,11 +3479,11 @@ describe('IndexexchangeAdapter', function () { const validBidWithConsent = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options); const requestWithConsent = extractPayload(validBidWithConsent[0]); - expect(requestWithConsent.user.ext.consented_providers_settings.consented_providers).to.equal('1~1.35.41.101'); + expect(requestWithConsent.user.ext.addtl_consent).to.equal('1~1.35.41.101'); expect(requestWithConsent.user.ext.consent).to.equal('3huaa11=qu3198ae'); }); - it('should not contain `consented_providers_settings.consented_providers` on user.ext when consent is not provided', function () { + it('should not contain `user.ext.addtl_consent` on user.ext when consent is not provided', function () { const options = { gdprConsent: { addtlConsent: '1~1.35.41.101', @@ -3492,7 +3492,7 @@ describe('IndexexchangeAdapter', function () { const validBidWithConsent = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options); const requestWithConsent = extractPayload(validBidWithConsent[0]); - expect(utils.deepAccess(requestWithConsent, 'user.ext.consented_providers_settings')).to.not.exist; + expect(utils.deepAccess(requestWithConsent, 'user.ext.addtl_consent')).to.not.exist; expect(utils.deepAccess(requestWithConsent, 'user.ext.consent')).to.not.exist; }); From 9847a035d5655d490cd5658e970e7c271929337b Mon Sep 17 00:00:00 2001 From: "shahin.rahbariasl" Date: Thu, 9 Mar 2023 20:01:20 -0500 Subject: [PATCH 2/2] feat: update additional consent field [PB-351] --- modules/ixBidAdapter.js | 4 +++- test/spec/modules/ixBidAdapter_spec.js | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 6909f876a90..a00fd90506a 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -832,7 +832,9 @@ function applyRegulations(r, bidderRequest) { }; if (gdprConsent.hasOwnProperty('addtlConsent') && gdprConsent.addtlConsent) { - r.user.ext.addtl_consent = gdprConsent.addtlConsent + r.user.ext.consented_providers_settings = { + addtl_consent: gdprConsent.addtlConsent + }; } } } diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index e5e580159b8..d0b2d7344b5 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -3469,7 +3469,7 @@ describe('IndexexchangeAdapter', function () { expect(requestWithConsent.regs.ext.us_privacy).to.equal('1YYN'); }); - it('should contain `user.ext.addtl_consent` & consent on user.ext when both are provided', function () { + it('should contain `consented_providers_settings.addtl_consent` & consent on user.ext when both are provided', function () { const options = { gdprConsent: { consentString: '3huaa11=qu3198ae', @@ -3479,11 +3479,11 @@ describe('IndexexchangeAdapter', function () { const validBidWithConsent = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options); const requestWithConsent = extractPayload(validBidWithConsent[0]); - expect(requestWithConsent.user.ext.addtl_consent).to.equal('1~1.35.41.101'); + expect(requestWithConsent.user.ext.consented_providers_settings.addtl_consent).to.equal('1~1.35.41.101'); expect(requestWithConsent.user.ext.consent).to.equal('3huaa11=qu3198ae'); }); - it('should not contain `user.ext.addtl_consent` on user.ext when consent is not provided', function () { + it('should not contain `consented_providers_settings.addtl_consent` on user.ext when consent is not provided', function () { const options = { gdprConsent: { addtlConsent: '1~1.35.41.101', @@ -3492,7 +3492,7 @@ describe('IndexexchangeAdapter', function () { const validBidWithConsent = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options); const requestWithConsent = extractPayload(validBidWithConsent[0]); - expect(utils.deepAccess(requestWithConsent, 'user.ext.addtl_consent')).to.not.exist; + expect(utils.deepAccess(requestWithConsent, 'user.ext.consented_providers_settings.addtl_consent')).to.not.exist; expect(utils.deepAccess(requestWithConsent, 'user.ext.consent')).to.not.exist; });