Skip to content

Commit aeaf23e

Browse files
Cadent Aperture MX Bid Adapter: Include gpp consent in usersync endpoint (#10404)
* Cadent Aperture MX Bid Adapter: Include gpp string and section id in usersync endpoint * Cadent Aperture MX Bid Adapter: lint fix --------- Co-authored-by: Michael Denton <[email protected]>
1 parent 2087aca commit aeaf23e

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

modules/cadentApertureMXBidAdapter.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export const spec = {
374374
}
375375
return cadentBidResponses;
376376
},
377-
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
377+
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
378378
const syncs = [];
379379
const consentParams = [];
380380
if (syncOptions.iframeEnabled) {
@@ -390,6 +390,14 @@ export const spec = {
390390
if (uspConsent && typeof uspConsent.consentString === 'string') {
391391
consentParams.push(`usp=${uspConsent.consentString}`);
392392
}
393+
if (gppConsent && typeof gppConsent === 'object') {
394+
if (gppConsent.gppString && typeof gppConsent.gppString === 'string') {
395+
consentParams.push(`gpp=${gppConsent.gppString}`);
396+
}
397+
if (gppConsent.applicableSections && typeof gppConsent.applicableSections === 'object') {
398+
consentParams.push(`gpp_sid=${gppConsent.applicableSections}`);
399+
}
400+
}
393401
if (consentParams.length > 0) {
394402
url = url + '?' + consentParams.join('&');
395403
}

test/spec/modules/cadentApertureMXBidAdapter_spec.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,5 +834,38 @@ describe('cadent_aperture_mx Adapter', function () {
834834
expect(syncs[0].url).to.contains('usp=test');
835835
expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=1&gdpr_consent=test&usp=test')
836836
});
837+
838+
it('should pass gpp string and section id', function() {
839+
let syncs = spec.getUserSyncs({iframeEnabled: true}, {}, {}, {}, {
840+
gppString: 'abcdefgs',
841+
applicableSections: [1, 2, 4]
842+
});
843+
expect(syncs).to.not.be.an('undefined');
844+
expect(syncs[0].url).to.contains('gpp=abcdefgs')
845+
expect(syncs[0].url).to.contains('gpp_sid=1,2,4')
846+
});
847+
848+
it('should pass us_privacy and gdpr string and gpp string', function () {
849+
let syncs = spec.getUserSyncs({ iframeEnabled: true }, {},
850+
{
851+
gdprApplies: true,
852+
consentString: 'test'
853+
},
854+
{
855+
consentString: 'test'
856+
},
857+
{
858+
gppString: 'abcdefgs',
859+
applicableSections: [1, 2, 4]
860+
}
861+
);
862+
expect(syncs).to.not.be.an('undefined');
863+
expect(syncs).to.have.lengthOf(1);
864+
expect(syncs[0].type).to.equal('iframe');
865+
expect(syncs[0].url).to.contains('gdpr=1');
866+
expect(syncs[0].url).to.contains('usp=test');
867+
expect(syncs[0].url).to.contains('gpp=abcdefgs');
868+
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');
869+
});
837870
});
838871
});

0 commit comments

Comments
 (0)