Skip to content

Commit

Permalink
PBS Bid Adapter: Fpd2.0 bug fix for first party data issue (prebid#6428)
Browse files Browse the repository at this point in the history
* Bug fix for PBS data from FPD2.0 update: Merging request.site and request.user with site and user object in FPD.
  • Loading branch information
mmoschovas authored and seergiioo6 committed Mar 23, 2021
1 parent 69872ef commit d3bf135
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,10 @@ const OPEN_RTB_PROTOCOL = {

const commonFpd = getConfig('ortb2') || {};
if (commonFpd.site) {
utils.deepSetValue(request, 'site', commonFpd.site);
utils.mergeDeep(request, {site: commonFpd.site});
}
if (commonFpd.user) {
utils.deepSetValue(request, 'user', commonFpd.user);
utils.mergeDeep(request, {user: commonFpd.user});
}
addBidderFirstPartyDataToRequest(request);

Expand Down
3 changes: 2 additions & 1 deletion test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1631,13 +1631,14 @@ describe('S2S Adapter', function () {
}
}
}));
const commonContextExpected = utils.mergeDeep({'page': 'http://mytestpage.com', 'publisher': {'id': '1'}}, commonContext);

config.setConfig({ fpd: { context: commonContext, user: commonUser } });
config.setBidderConfig({ bidders: allowedBidders, config: { fpd: { context, user } } });
adapter.callBids(s2sBidRequest, bidRequests, addBidResponse, done, ajax);
const parsedRequestBody = JSON.parse(server.requests[0].requestBody);
expect(parsedRequestBody.ext.prebid.bidderconfig).to.deep.equal(expected);
expect(parsedRequestBody.site).to.deep.equal(commonContext);
expect(parsedRequestBody.site).to.deep.equal(commonContextExpected);
expect(parsedRequestBody.user).to.deep.equal(commonUser);
});

Expand Down

0 comments on commit d3bf135

Please sign in to comment.