Skip to content

Commit

Permalink
Sharethrough Bid Adapter: Fix bcat and badv from First Party Data (
Browse files Browse the repository at this point in the history
…prebid#8808)

* [PGE-178206885] Fix bcat and badv via first party data

PGE-178206885

* Fix version number
  • Loading branch information
Mathieu Pheulpin authored and JacobKlein26 committed Feb 8, 2023
1 parent ae5ba9c commit c748f22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions modules/sharethroughBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config } from '../src/config.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { createEidsArray } from './userId/eids.js';

const VERSION = '4.1.1';
const VERSION = '4.2.0';
const BIDDER_CODE = 'sharethrough';
const SUPPLY_ID = 'WYu2BXv1';

Expand Down Expand Up @@ -58,8 +58,8 @@ export const sharethroughAdapterSpec = {
schain: bidRequests[0].schain,
},
},
bcat: deepAccess(bidderRequest.ortb2Imp, 'bcat') || bidRequests[0].params.bcat || [],
badv: bidRequests[0].params.badv || [],
bcat: deepAccess(bidderRequest.ortb2, 'bcat') || bidRequests[0].params.bcat || [],
badv: deepAccess(bidderRequest.ortb2, 'badv') || bidRequests[0].params.badv || [],
test: 0,
};

Expand Down
11 changes: 10 additions & 1 deletion test/spec/modules/sharethroughBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ describe('sharethrough adapter spec', function () {
},
},
},
bcat: ['IAB1', 'IAB2-1'],
badv: ['domain1.com', 'domain2.com'],
};

it('should include first party data in open rtb request, site section', () => {
Expand All @@ -493,13 +495,20 @@ describe('sharethrough adapter spec', function () {
});

it('should include first party data in open rtb request, user section', () => {
const openRtbReq = spec.buildRequests(bidRequests, {...bidderRequest, ortb2: firstPartyData})[0].data;
const openRtbReq = spec.buildRequests(bidRequests, { ...bidderRequest, ortb2: firstPartyData })[0].data;

expect(openRtbReq.user.yob).to.equal(firstPartyData.user.yob);
expect(openRtbReq.user.gender).to.equal(firstPartyData.user.gender);
expect(openRtbReq.user.ext.data).to.deep.equal(firstPartyData.user.ext.data);
expect(openRtbReq.user.ext.eids).not.to.be.undefined;
});

it('should include first party data in open rtb request, ORTB blocked section', () => {
const openRtbReq = spec.buildRequests(bidRequests, { ...bidderRequest, ortb2: firstPartyData })[0].data;

expect(openRtbReq.bcat).to.deep.equal(firstPartyData.bcat);
expect(openRtbReq.badv).to.deep.equal(firstPartyData.badv);
});
});
});

Expand Down

0 comments on commit c748f22

Please sign in to comment.