Skip to content

Commit

Permalink
Adform adapter: ortb2Imp first party data (prebid#11616)
Browse files Browse the repository at this point in the history
  • Loading branch information
braizhas authored May 30, 2024
1 parent c73147e commit ec7b909
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/adfBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ export const spec = {
const bidfloor = floorInfo.floor;
const bidfloorcur = floorInfo.currency;
const { mid, inv, mname } = bid.params;
const impExtData = bid.ortb2Imp?.ext?.data;

const imp = {
id: id + 1,
tagid: mid,
bidfloor,
bidfloorcur,
ext: {
data: impExtData,
bidder: {
inv,
mname
Expand Down
12 changes: 12 additions & 0 deletions test/spec/modules/adfBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ describe('Adf adapter', function () {
}
});

it('should add first party data', function () {
let validBidRequests = [
{ bidId: 'bidId', params: { mid: 1000 }, mediaTypes: { video: {} }, ortb2Imp: { ext: { data: { some: 'value' } } } },
{ bidId: 'bidId2', params: { mid: 1001 }, mediaTypes: { video: {} }, ortb2Imp: { ext: { data: { some: 'value', another: 1 } } } },
{ bidId: 'bidId3', params: { mid: 1002 }, mediaTypes: { video: {} }, ortb2Imp: { ext: {} } }
];
let imps = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { page: 'page' } }).data).imp;
for (let i = 0; i < 3; i++) {
assert.deepEqual(imps[i].ext.data, validBidRequests[i].ortb2Imp.ext.data);
}
});

describe('dynamic placement tag', function () {
it('should add imp parameters correctly', function () {
const validBidRequests = [
Expand Down

0 comments on commit ec7b909

Please sign in to comment.