Skip to content

Commit

Permalink
IX Bid Adapter: update additional consent field (#9650)
Browse files Browse the repository at this point in the history
* feat: update additional consent location [PB-351]

* feat: update additional consent field [PB-351]

---------

Co-authored-by: shahin.rahbariasl <shahin.rahbariasl@indexexchange.com>
  • Loading branch information
shahinrahbariasl and shahin-rahbariasl authored Mar 13, 2023
1 parent f59c3a2 commit d874a0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ function applyRegulations(r, bidderRequest) {

if (gdprConsent.hasOwnProperty('addtlConsent') && gdprConsent.addtlConsent) {
r.user.ext.consented_providers_settings = {
consented_providers: gdprConsent.addtlConsent
addtl_consent: gdprConsent.addtlConsent
};
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `consented_providers_settings.addtl_consent` & consent on user.ext when both are provided', function () {
const options = {
gdprConsent: {
consentString: '3huaa11=qu3198ae',
Expand All @@ -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.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 `consented_providers_settings.consented_providers` 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',
Expand All @@ -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.consented_providers_settings.addtl_consent')).to.not.exist;
expect(utils.deepAccess(requestWithConsent, 'user.ext.consent')).to.not.exist;
});

Expand Down

0 comments on commit d874a0b

Please sign in to comment.