Skip to content

Commit

Permalink
Improve Digital PG flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jbartek25 committed Nov 13, 2023
1 parent 2aadc09 commit b8fb6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/improvedigitalBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ export const CONVERTER = ortbConverter({
})();
const bidResponse = buildBidResponse(bid, context);
const idExt = deepAccess(bid, `ext.${BIDDER_CODE}`, {});
// Programmatic guaranteed flag
if (idExt.pg === 1) {
bidResponse.adserverTargeting = { hb_deal_type_improve: 'pg' };
}
Object.assign(bidResponse, {
dealId: (typeof idExt.buying_type === 'string' && idExt.buying_type !== 'rtb') ? idExt.line_item_id : undefined,
netRevenue: idExt.is_net || false,
Expand Down
10 changes: 10 additions & 0 deletions test/spec/modules/improvedigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,16 @@ describe('Improve Digital Adapter Tests', function () {
expect(bids[0].dealId).to.equal(268515);
});

it('should set deal type targeting KV for PG', function () {
const request = makeRequest(bidderRequest);
const response = deepClone(serverResponse);
let bids;

response.body.seatbid[0].bid[0].ext.improvedigital.pg = 1;
bids = spec.interpretResponse(response, request);
expect(bids[0].adserverTargeting.hb_deal_type_improve).to.equal('pg');
});

it('should set currency', function () {
const response = deepClone(serverResponse);
response.body.cur = 'EUR';
Expand Down

0 comments on commit b8fb6f2

Please sign in to comment.