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

Onetag Bid Adapter: add support for FPD (ortb2 field) #10329

Merged
merged 3 commits into from
Aug 9, 2023
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
3 changes: 3 additions & 0 deletions modules/onetagBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ function buildRequests(validBidRequests, bidderRequest) {
if (bidderRequest && bidderRequest.uspConsent) {
payload.usPrivacy = bidderRequest.uspConsent;
}
if (bidderRequest && bidderRequest.ortb2) {
payload.ortb2 = bidderRequest.ortb2;
}
if (validBidRequests && validBidRequests.length !== 0 && validBidRequests[0].userIdAsEids) {
payload.userId = validBidRequests[0].userIdAsEids;
}
Expand Down
69 changes: 69 additions & 0 deletions test/spec/modules/onetagBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,75 @@ describe('onetag', function () {
expect(payload.usPrivacy).to.exist;
expect(payload.usPrivacy).to.exist.and.to.equal(consentString);
});
it('Should send FPD (ortb2 field)', function () {
const firtPartyData = {
// this is where the contextual data is placed
site: {
name: 'example',
domain: 'page.example.com',
// OpenRTB 2.5 spec / Content Taxonomy
cat: ['IAB2'],
sectioncat: ['IAB2-2'],
pagecat: ['IAB2-2'],
page: 'https://page.example.com/here.html',
ref: 'https://ref.example.com',
keywords: 'power tools, drills',
search: 'drill',
content: {
userrating: '4',
data: [{
name: 'www.dataprovider1.com', // who resolved the segments
ext: {
segtax: 7, // taxonomy used to encode the segments
cids: ['iris_c73g5jq96mwso4d8']
},
// the bare minimum are the IDs. These IDs are the ones from the new IAB Content Taxonomy v3
segment: [ { id: '687' }, { id: '123' } ]
}]
},
ext: {
data: { // fields that aren't part of openrtb 2.6
pageType: 'article',
category: 'repair'
}
}
},
// this is where the user data is placed
user: {
keywords: 'a,b',
data: [{
name: 'dataprovider.com',
ext: {
segtax: 4
},
segment: [{
id: '1'
}]
}],
ext: {
data: {
registered: true,
interests: ['cars']
}
}
},
regs: {
gpp: 'abc1234',
gpp_sid: [7]
}
};
let bidderRequest = {
'bidderCode': 'onetag',
'auctionId': '1d1a030790a475',
'bidderRequestId': '22edbae2733bf6',
'timeout': 3000,
'ortb2': firtPartyData
}
let serverRequest = spec.buildRequests([bannerBid], bidderRequest);
const payload = JSON.parse(serverRequest.data);
expect(payload.ortb2).to.exist;
expect(payload.ortb2).to.exist.and.to.deep.equal(firtPartyData);
});
});
describe('interpretResponse', function () {
const request = getBannerVideoRequest();
Expand Down