Skip to content

Commit

Permalink
Taboola bid adapter add ortb2 device (#11750)
Browse files Browse the repository at this point in the history
* Taboola Bid Adapter: Add full ORTB2 device data to request payload

* Taboola Bid Adapter: Modify FPD test to verify presence of ORTB2 device data in request

* Taboola Bid Adapter: Remove device data fallback and add ortb2 device data to `commonBidderRequest` (tests) as it is always present in real-world scenarios

---------

Co-authored-by: Bohdan V <[email protected]>
  • Loading branch information
jwrosewell and BohdanVV authored Dec 26, 2024
1 parent eb225a8 commit 059e77f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/taboolaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function getSiteProperties({publisherId}, refererInfo, ortb2) {
function fillTaboolaReqData(bidderRequest, bidRequest, data) {
const {refererInfo, gdprConsent = {}, uspConsent} = bidderRequest;
const site = getSiteProperties(bidRequest.params, refererInfo, bidderRequest.ortb2);
deepSetValue(data, 'device.ua', navigator.userAgent);
deepSetValue(data, 'device', bidderRequest?.ortb2?.device);
const extractedUserId = userData.getUserId(gdprConsent, uspConsent);
if (data.user == undefined) {
data.user = {
Expand Down
22 changes: 20 additions & 2 deletions test/spec/modules/taboolaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ describe('Taboola Adapter', function () {
page: 'https://example.com/ref',
ref: 'https://ref',
domain: 'example.com',
},
ortb2: {
device: {
ua: navigator.userAgent,
},
}
}

Expand All @@ -198,9 +203,9 @@ describe('Taboola Adapter', function () {
'bidfloorcur': 'USD',
'ext': {}
}],
id: 'mock-uuid',
'test': 0,
'device': {'ua': navigator.userAgent},
'id': 'mock-uuid',
'test': 0,
'user': {
'buyeruid': 0,
'ext': {},
Expand Down Expand Up @@ -366,6 +371,18 @@ describe('Taboola Adapter', function () {
wlang: ['de'],
user: {
id: 'externalUserIdPassed'
},
device: {
w: 980,
h: 1720,
dnt: 0,
ua: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/125.0.6422.80 Mobile/15E148 Safari/604.1',
language: 'en',
devicetype: 1,
make: 'Apple',
model: 'iPhone 12 Pro Max',
os: 'iOS',
osv: '17.4'
}
}
}
Expand All @@ -374,6 +391,7 @@ describe('Taboola Adapter', function () {
expect(res.data.badv).to.deep.equal(bidderRequest.ortb2.badv)
expect(res.data.wlang).to.deep.equal(bidderRequest.ortb2.wlang)
expect(res.data.user.id).to.deep.equal(bidderRequest.ortb2.user.id)
expect(res.data.device).to.deep.equal(bidderRequest.ortb2.device);
});

it('should pass user entities', function () {
Expand Down

0 comments on commit 059e77f

Please sign in to comment.