From baad436f17d886a832d7bf7254dde9dbe0b861c6 Mon Sep 17 00:00:00 2001 From: shahinrahbariasl <56240400+shahinrahbariasl@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:49:36 -0400 Subject: [PATCH] feat: set request source tid to auctionId [PB-1296] (#9051) Co-authored-by: shahin.rahbariasl --- modules/ixBidAdapter.js | 12 +++++++----- test/spec/modules/ixBidAdapter_spec.js | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 5be14ca6a21..1d2dd5b9908 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -602,13 +602,15 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { r.ext.ixdiag.err = cachedErrors; } + // set source.tid to auctionId for outgoing request to Exchange. + r.source = { + tid: validBidRequests[0].auctionId, + } + // if an schain is provided, send it along if (validBidRequests[0].schain) { - r.source = { - ext: { - schain: validBidRequests[0].schain - } - }; + r.source.ext = {}; + r.source.ext.schain = validBidRequests[0].schain; } if (userEids.length > 0) { diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index ad3ac279712..b9001a556b1 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -1739,6 +1739,7 @@ describe('IndexexchangeAdapter', function () { expect(payload.source.ext.schain).to.deep.equal(SAMPLE_SCHAIN); expect(payload.imp).to.be.an('array'); expect(payload.imp).to.have.lengthOf(1); + expect(payload.source.tid).to.equal(DEFAULT_BANNER_VALID_BID[0].auctionId); }); it('payload should have correct format and value for r.id when bidderRequestId is a number ', function () { @@ -1767,7 +1768,7 @@ describe('IndexexchangeAdapter', function () { it('payload should not include schain when not provided', function () { const payload = JSON.parse(queryWithoutSchain.r); - expect(payload.source).to.not.exist; // source object currently only written for schain + expect(payload.source.schain).to.not.exist; // source object currently only written for schain }); it('impression should have correct format and value', function () {