From 059e77f488ab78b503813310e405403c75126d55 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Thu, 26 Dec 2024 16:25:11 +0000 Subject: [PATCH] Taboola bid adapter add ortb2 device (#11750) * 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 <25197509+BohdanVV@users.noreply.github.com> --- modules/taboolaBidAdapter.js | 2 +- test/spec/modules/taboolaBidAdapter_spec.js | 22 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/taboolaBidAdapter.js b/modules/taboolaBidAdapter.js index 7d1c58bcdcf..b4755678052 100644 --- a/modules/taboolaBidAdapter.js +++ b/modules/taboolaBidAdapter.js @@ -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 = { diff --git a/test/spec/modules/taboolaBidAdapter_spec.js b/test/spec/modules/taboolaBidAdapter_spec.js index 5db0c8cf306..d71a701e93b 100644 --- a/test/spec/modules/taboolaBidAdapter_spec.js +++ b/test/spec/modules/taboolaBidAdapter_spec.js @@ -173,6 +173,11 @@ describe('Taboola Adapter', function () { page: 'https://example.com/ref', ref: 'https://ref', domain: 'example.com', + }, + ortb2: { + device: { + ua: navigator.userAgent, + }, } } @@ -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': {}, @@ -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' } } } @@ -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 () {