Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adform Bid Adapter: ortb2Imp first party data #11616

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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