diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index 69da9ab6db3..034b861f0f7 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -265,6 +265,7 @@ export const spec = { const containsTgI = /^tg_i/ const orderedParams = [ + 'tpid_tdid', 'account_id', 'site_id', 'zone_id', @@ -367,6 +368,10 @@ export const spec = { 'rf': _getPageUrl(bidRequest, bidderRequest) }; + if ((bidRequest.userId || {}).tdid) { + data['tpid_tdid'] = bidRequest.userId.tdid; + } + if (bidderRequest.gdprConsent) { // add 'gdpr' only if 'gdprApplies' is defined if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') { diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 53fa45e89ae..f3b244b1bc1 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1060,6 +1060,19 @@ describe('the rubicon adapter', function () { expect(serverRequests).that.is.an('array').of.length(3); }); }); + + describe('user id config', function() { + it('should send tpid_tdid when userId defines tdid', function () { + const clonedBid = clone(bidderRequest.bids[0]); + clonedBid.userId = { + tdid: 'abcd-efgh-ijkl-mnop-1234' + }; + let [request] = spec.buildRequests([clonedBid], bidderRequest); + let data = parseQuery(request.data); + + expect(data['tpid_tdid']).to.equal('abcd-efgh-ijkl-mnop-1234'); + }); + }) }); describe('for video requests', function () {