diff --git a/modules/yieldoneBidAdapter.js b/modules/yieldoneBidAdapter.js index 69a5def17bd..95c0a5b787a 100644 --- a/modules/yieldoneBidAdapter.js +++ b/modules/yieldoneBidAdapter.js @@ -31,6 +31,8 @@ export const spec = { const transactionId = bidRequest.transactionId; const unitCode = bidRequest.adUnitCode; const timeout = config.getConfig('bidderTimeout'); + const language = window.navigator.language; + const screenSize = window.screen.width + 'x' + window.screen.height; const payload = { v: 'hb1', p: placementId, @@ -40,7 +42,9 @@ export const spec = { tid: transactionId, uc: unitCode, tmax: timeout, - t: 'i' + t: 'i', + language: language, + screen_size: screenSize }; const mediaType = getMediaType(bidRequest); @@ -69,6 +73,13 @@ export const spec = { payload.imuid = imuid; } + // DACID + const dacId = deepAccess(bidRequest, 'userId.dacId.id'); + if (isStr(dacId) && !isEmpty(dacId)) { + payload.dac_id = dacId; + payload.fuuid = dacId; + } + return { method: 'GET', url: ENDPOINT_URL, diff --git a/test/spec/modules/yieldoneBidAdapter_spec.js b/test/spec/modules/yieldoneBidAdapter_spec.js index d452d78e147..eef25649a02 100644 --- a/test/spec/modules/yieldoneBidAdapter_spec.js +++ b/test/spec/modules/yieldoneBidAdapter_spec.js @@ -399,6 +399,43 @@ describe('yieldoneBidAdapter', function() { expect(request[0].data.imuid).to.equal('imuid_sample'); }); }); + + describe('DAC ID', function () { + it('dont send DAC ID if undefined', function () { + const bidRequests = [ + { + params: {placementId: '0'}, + }, + { + params: {placementId: '1'}, + userId: {}, + }, + { + params: {placementId: '2'}, + userId: undefined, + }, + ]; + const request = spec.buildRequests(bidRequests, bidderRequest); + expect(request[0].data).to.not.have.property('dac_id'); + expect(request[1].data).to.not.have.property('dac_id'); + expect(request[2].data).to.not.have.property('dac_id'); + expect(request[0].data).to.not.have.property('fuuid'); + expect(request[1].data).to.not.have.property('fuuid'); + expect(request[2].data).to.not.have.property('fuuid'); + }); + + it('should send DAC ID if available', function () { + const bidRequests = [ + { + params: {placementId: '0'}, + userId: {dacId: {id: 'dacId_sample'}}, + }, + ]; + const request = spec.buildRequests(bidRequests, bidderRequest); + expect(request[0].data.dac_id).to.equal('dacId_sample'); + expect(request[0].data.fuuid).to.equal('dacId_sample'); + }); + }); }); describe('interpretResponse', function () { @@ -413,7 +450,9 @@ describe('yieldoneBidAdapter', function() { 'cb': 12892917383, 'r': 'http%3A%2F%2Flocalhost%3A9876%2F%3Fid%3D74552836', 'uid': '23beaa6af6cdde', - 't': 'i' + 't': 'i', + 'language': 'ja', + 'screen_size': '1440x900' } } ]; @@ -486,7 +525,9 @@ describe('yieldoneBidAdapter', function() { 'cb': 12892917383, 'r': 'http%3A%2F%2Flocalhost%3A9876%2F%3Fid%3D74552836', 'uid': '23beaa6af6cdde', - 't': 'i' + 't': 'i', + 'language': 'ja', + 'screen_size': '1440x900' } } ];