From 2fd3c219fa5497c2bdb0a96a6a9ec9c3948efee3 Mon Sep 17 00:00:00 2001 From: Murtaza Haji Date: Thu, 17 Aug 2023 14:44:57 -0500 Subject: [PATCH 1/2] add gpp support to usersync endpoint --- modules/cadentApertureMXBidAdapter.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/cadentApertureMXBidAdapter.js b/modules/cadentApertureMXBidAdapter.js index 22ed0590e05..282fd40fefb 100644 --- a/modules/cadentApertureMXBidAdapter.js +++ b/modules/cadentApertureMXBidAdapter.js @@ -374,7 +374,7 @@ export const spec = { } return cadentBidResponses; }, - getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) { + getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) { const syncs = []; const consentParams = []; if (syncOptions.iframeEnabled) { @@ -390,6 +390,14 @@ export const spec = { if (uspConsent && typeof uspConsent.consentString === 'string') { consentParams.push(`usp=${uspConsent.consentString}`); } + if(gppConsent && typeof gppConsent !== 'object'){ + if(gppConsent.gppString && typeof gppConsent.gppString === 'string'){ + consentParams.push(`gpp=${gppConsent.gppString}`); + } + if(gppConsent.applicableSections && typeof gppConsent.applicableSections !== 'object'){ + consentParams.push(`gpp_sid=${gppConsent.applicableSections}`); + } + } if (consentParams.length > 0) { url = url + '?' + consentParams.join('&'); } From 9ba01f5dfee06c2a95096bd6050f65ce29898a3a Mon Sep 17 00:00:00 2001 From: Murtaza Haji Date: Tue, 22 Aug 2023 09:31:24 -0500 Subject: [PATCH 2/2] added usersync support for gpp --- modules/cadentApertureMXBidAdapter.js | 4 +-- .../cadentApertureMXBidAdapter_spec.js | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/modules/cadentApertureMXBidAdapter.js b/modules/cadentApertureMXBidAdapter.js index 282fd40fefb..7626683f137 100644 --- a/modules/cadentApertureMXBidAdapter.js +++ b/modules/cadentApertureMXBidAdapter.js @@ -390,11 +390,11 @@ export const spec = { if (uspConsent && typeof uspConsent.consentString === 'string') { consentParams.push(`usp=${uspConsent.consentString}`); } - if(gppConsent && typeof gppConsent !== 'object'){ + if(gppConsent && typeof gppConsent === 'object'){ if(gppConsent.gppString && typeof gppConsent.gppString === 'string'){ consentParams.push(`gpp=${gppConsent.gppString}`); } - if(gppConsent.applicableSections && typeof gppConsent.applicableSections !== 'object'){ + if(gppConsent.applicableSections && typeof gppConsent.applicableSections === 'object'){ consentParams.push(`gpp_sid=${gppConsent.applicableSections}`); } } diff --git a/test/spec/modules/cadentApertureMXBidAdapter_spec.js b/test/spec/modules/cadentApertureMXBidAdapter_spec.js index 64f3d047a3a..106ae2fa952 100644 --- a/test/spec/modules/cadentApertureMXBidAdapter_spec.js +++ b/test/spec/modules/cadentApertureMXBidAdapter_spec.js @@ -834,5 +834,38 @@ describe('cadent_aperture_mx Adapter', function () { expect(syncs[0].url).to.contains('usp=test'); expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=1&gdpr_consent=test&usp=test') }); + + it('should pass gpp string and section id' , function(){ + let syncs = spec.getUserSyncs({iframeEnabled: true}, {}, {},{}, { + gppString: 'abcdefgs', + applicableSections: [1,2,4] + }); + expect(syncs).to.not.be.an('undefined'); + expect(syncs[0].url).to.contains('gpp=abcdefgs') + expect(syncs[0].url).to.contains('gpp_sid=1,2,4') + }); + + it('should pass us_privacy and gdpr string and gpp string', function () { + let syncs = spec.getUserSyncs({ iframeEnabled: true }, {}, + { + gdprApplies: true, + consentString: 'test' + }, + { + consentString: 'test' + }, + { + gppString: 'abcdefgs', + applicableSections: [1,2,4] + } + ); + expect(syncs).to.not.be.an('undefined'); + expect(syncs).to.have.lengthOf(1); + expect(syncs[0].type).to.equal('iframe'); + expect(syncs[0].url).to.contains('gdpr=1'); + expect(syncs[0].url).to.contains('usp=test'); + expect(syncs[0].url).to.contains('gpp=abcdefgs'); + expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=1&gdpr_consent=test&usp=test&gpp=abcdefgs&gpp_sid=1,2,4'); + }); }); });