From c19e85523840179ca0ca06ffb5df85089035d79d Mon Sep 17 00:00:00 2001 From: logicad Date: Mon, 12 Apr 2021 11:08:52 +0900 Subject: [PATCH] Logicad Bid Adapter: add support for userid modules (#6529) --- modules/logicadBidAdapter.js | 1 + test/spec/modules/logicadBidAdapter_spec.js | 41 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/modules/logicadBidAdapter.js b/modules/logicadBidAdapter.js index 0bf6b886dee..2c919f9c157 100644 --- a/modules/logicadBidAdapter.js +++ b/modules/logicadBidAdapter.js @@ -62,6 +62,7 @@ function newBidRequest(bid, bidderRequest) { prebidJsVersion: '$prebid.version$', referrer: bidderRequest.refererInfo.referer, auctionStartTime: bidderRequest.auctionStart, + eids: bid.userIdAsEids, }; } diff --git a/test/spec/modules/logicadBidAdapter_spec.js b/test/spec/modules/logicadBidAdapter_spec.js index c4c06630a2b..6eb8dc1c043 100644 --- a/test/spec/modules/logicadBidAdapter_spec.js +++ b/test/spec/modules/logicadBidAdapter_spec.js @@ -19,7 +19,23 @@ describe('LogicadAdapter', function () { banner: { sizes: [[300, 250], [300, 600]] } - } + }, + userId: { + sharedid: { + id: 'fakesharedid', + third: 'fakesharedid' + } + }, + userIdAsEids: [{ + source: 'sharedid.org', + uids: [{ + id: 'fakesharedid', + atype: 1, + ext: { + third: 'fakesharedid' + } + }] + }] }]; const nativeBidRequests = [{ bidder: 'logicad', @@ -45,7 +61,23 @@ describe('LogicadAdapter', function () { required: true } } - } + }, + userId: { + sharedid: { + id: 'fakesharedid', + third: 'fakesharedid' + } + }, + userIdAsEids: [{ + source: 'sharedid.org', + uids: [{ + id: 'fakesharedid', + atype: 1, + ext: { + third: 'fakesharedid' + } + }] + }] }]; const bidderRequest = { refererInfo: { @@ -141,6 +173,11 @@ describe('LogicadAdapter', function () { expect(request.method).to.equal('POST'); expect(request.url).to.equal('https://pb.ladsp.com/adrequest/prebid'); expect(request.data).to.exist; + + const data = JSON.parse(request.data); + expect(data.auctionId).to.equal('18fd8b8b0bd757'); + expect(data.eids[0].source).to.equal('sharedid.org'); + expect(data.eids[0].uids[0].id).to.equal('fakesharedid'); }); });