Skip to content

Commit

Permalink
Emx Digital Bid Adapter : adding US Privacy string support (prebid#9461)
Browse files Browse the repository at this point in the history
* 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 <rakesh.balakrishnan@emxdigital.com>

* kick off ci tests

Co-authored-by: Nick Colletti <nick.colletti@emxdigital.com>
Co-authored-by: Nick Colletti <gnomish@gmail.com>
Co-authored-by: Kiyoshi Hara <Kiyoshi.Hara@emxdigital.com>
Co-authored-by: Dan Bogdan <daniel.bogdan@emxdigital.com>
Co-authored-by: Jherez Taylor <jherez.taylor@emxdigital.com>
Co-authored-by: EMXDigital <emxdigital@emxdigital.com>
Co-authored-by: Rakesh Balakrishnan <Rakesh.Balakrishnan@emxdigital.com>
Co-authored-by: Kevin <kevin.hagens@brealtime.com>
Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
10 people authored Jan 25, 2023
1 parent da42b1b commit 628c229
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
11 changes: 9 additions & 2 deletions modules/emx_digitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,23 @@ export const spec = {
},
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
const syncs = [];
const consentParams = [];
if (syncOptions.iframeEnabled) {
let url = 'https://biddr.brealtime.com/check.html';
if (gdprConsent && typeof gdprConsent.consentString === 'string') {
// add 'gdpr' only if 'gdprApplies' is defined
if (typeof gdprConsent.gdprApplies === 'boolean') {
url += `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
consentParams.push(`gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`);
} else {
url += `?gdpr_consent=${gdprConsent.consentString}`;
consentParams.push(`?gdpr_consent=${gdprConsent.consentString}`);
}
}
if (uspConsent && typeof uspConsent.consentString === 'string') {
consentParams.push(`usp=${uspConsent.consentString}`);
}
if (consentParams.length > 0) {
url = url + '?' + consentParams.join('&');
}
syncs.push({
type: 'iframe',
url: url
Expand Down
31 changes: 30 additions & 1 deletion test/spec/modules/emx_digitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ describe('emx_digital Adapter', function () {
}));
});

it('returns valid advertiser domain', function () {
it('returns valid advertiser domains', function () {
const bidResponse = utils.deepClone(serverResponse);
let result = spec.interpretResponse({body: bidResponse});
expect(result[0].meta.advertiserDomains).to.deep.equal(expectedResponse[0].meta.advertiserDomains);
Expand All @@ -724,6 +724,7 @@ describe('emx_digital Adapter', function () {
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.equal('https://biddr.brealtime.com/check.html')
});

it('should pass gdpr params', function () {
Expand All @@ -734,6 +735,34 @@ describe('emx_digital Adapter', function () {
expect(syncs).to.have.lengthOf(1);
expect(syncs[0].type).to.equal('iframe');
expect(syncs[0].url).to.contains('gdpr=0');
expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=0&gdpr_consent=test')
});

it('should pass us_privacy string', function () {
let syncs = spec.getUserSyncs({ iframeEnabled: true }, {}, {}, {
consentString: 'test',
});
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('usp=test');
});

it('should pass us_privacy and gdpr strings', function () {
let syncs = spec.getUserSyncs({ iframeEnabled: true }, {},
{
gdprApplies: true,
consentString: 'test'
},
{
consentString: 'test'
});
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.equal('https://biddr.brealtime.com/check.html?gdpr=1&gdpr_consent=test&usp=test')
});
});
});

0 comments on commit 628c229

Please sign in to comment.