Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 628c229

Browse files
EMXDigitalNick CollettincollettiKiyoshi HaraDBogdanEMX
authored
Emx Digital Bid Adapter : adding US Privacy string support (prebid#9461)
* adding ccpa support for emx_digital adapter * emx_digital ccpa compliance: lint fix * emx 3.0 compliance update * fix outstream renderer issue, update test spec * refactor formatVideoResponse function to use core-js/find * Add support for schain forwarding * Resolved issue with Schain object location * prebid 5.0 floor module and advertiserDomain support * liveramp idl and uid2.0 support for prebid * gpid support * remove utils ext * remove empty line * remove trailing spaces * move gpid test module * move gpid test module * removing trailing spaces from unit test * remove comments from unit test * Include us_privacy string in redirects (#8) * include us_privacy string in redirects * added test cases for us_privacy and gdpr * added test cases for gdpr without usp * updated test case when no privacy strings and fixed package-lock.json * revert package-lock.json Co-authored-by: EMXDigital <[email protected]> * kick off ci tests Co-authored-by: Nick Colletti <[email protected]> Co-authored-by: Nick Colletti <[email protected]> Co-authored-by: Kiyoshi Hara <[email protected]> Co-authored-by: Dan Bogdan <[email protected]> Co-authored-by: Jherez Taylor <[email protected]> Co-authored-by: EMXDigital <[email protected]> Co-authored-by: Rakesh Balakrishnan <[email protected]> Co-authored-by: Kevin <[email protected]> Co-authored-by: Chris Huie <[email protected]>
1 parent da42b1b commit 628c229

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

modules/emx_digitalBidAdapter.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -354,16 +354,23 @@ export const spec = {
354354
},
355355
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
356356
const syncs = [];
357+
const consentParams = [];
357358
if (syncOptions.iframeEnabled) {
358359
let url = 'https://biddr.brealtime.com/check.html';
359360
if (gdprConsent && typeof gdprConsent.consentString === 'string') {
360361
// add 'gdpr' only if 'gdprApplies' is defined
361362
if (typeof gdprConsent.gdprApplies === 'boolean') {
362-
url += `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
363+
consentParams.push(`gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`);
363364
} else {
364-
url += `?gdpr_consent=${gdprConsent.consentString}`;
365+
consentParams.push(`?gdpr_consent=${gdprConsent.consentString}`);
365366
}
366367
}
368+
if (uspConsent && typeof uspConsent.consentString === 'string') {
369+
consentParams.push(`usp=${uspConsent.consentString}`);
370+
}
371+
if (consentParams.length > 0) {
372+
url = url + '?' + consentParams.join('&');
373+
}
367374
syncs.push({
368375
type: 'iframe',
369376
url: url

test/spec/modules/emx_digitalBidAdapter_spec.js

+30-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ describe('emx_digital Adapter', function () {
707707
}));
708708
});
709709

710-
it('returns valid advertiser domain', function () {
710+
it('returns valid advertiser domains', function () {
711711
const bidResponse = utils.deepClone(serverResponse);
712712
let result = spec.interpretResponse({body: bidResponse});
713713
expect(result[0].meta.advertiserDomains).to.deep.equal(expectedResponse[0].meta.advertiserDomains);
@@ -724,6 +724,7 @@ describe('emx_digital Adapter', function () {
724724
expect(syncs).to.not.be.an('undefined');
725725
expect(syncs).to.have.lengthOf(1);
726726
expect(syncs[0].type).to.equal('iframe');
727+
expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html')
727728
});
728729

729730
it('should pass gdpr params', function () {
@@ -734,6 +735,34 @@ describe('emx_digital Adapter', function () {
734735
expect(syncs).to.have.lengthOf(1);
735736
expect(syncs[0].type).to.equal('iframe');
736737
expect(syncs[0].url).to.contains('gdpr=0');
738+
expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=0&gdpr_consent=test')
739+
});
740+
741+
it('should pass us_privacy string', function () {
742+
let syncs = spec.getUserSyncs({ iframeEnabled: true }, {}, {}, {
743+
consentString: 'test',
744+
});
745+
expect(syncs).to.not.be.an('undefined');
746+
expect(syncs).to.have.lengthOf(1);
747+
expect(syncs[0].type).to.equal('iframe');
748+
expect(syncs[0].url).to.contains('usp=test');
749+
});
750+
751+
it('should pass us_privacy and gdpr strings', function () {
752+
let syncs = spec.getUserSyncs({ iframeEnabled: true }, {},
753+
{
754+
gdprApplies: true,
755+
consentString: 'test'
756+
},
757+
{
758+
consentString: 'test'
759+
});
760+
expect(syncs).to.not.be.an('undefined');
761+
expect(syncs).to.have.lengthOf(1);
762+
expect(syncs[0].type).to.equal('iframe');
763+
expect(syncs[0].url).to.contains('gdpr=1');
764+
expect(syncs[0].url).to.contains('usp=test');
765+
expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=1&gdpr_consent=test&usp=test')
737766
});
738767
});
739768
});

0 commit comments

Comments
 (0)