From eac5e043e55538a92677100d457437b76ca898ed Mon Sep 17 00:00:00 2001 From: Victor <103455651+victorlassomarketing@users.noreply.github.com> Date: Mon, 8 Apr 2024 02:24:00 -0700 Subject: [PATCH 1/8] Lasso Bid Adapter: add gpp support (#11256) * Add gpp support and variable name update * correct unit test --- modules/lassoBidAdapter.js | 13 +++++++++++-- test/spec/modules/lassoBidAdapter_spec.js | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/lassoBidAdapter.js b/modules/lassoBidAdapter.js index e1f9636e4f1..6215af03a97 100644 --- a/modules/lassoBidAdapter.js +++ b/modules/lassoBidAdapter.js @@ -37,7 +37,6 @@ export const spec = { url: encodeURIComponent(window.location.href), bidderRequestId: bidRequest.bidderRequestId, adUnitCode: bidRequest.adUnitCode, - // TODO: fix auctionId leak: https://github.com/prebid/Prebid.js/issues/9781 auctionId: bidRequest.auctionId, bidId: bidRequest.bidId, transactionId: bidRequest.ortb2Imp?.ext?.tid, @@ -48,11 +47,20 @@ export const spec = { params: JSON.stringify(bidRequest.params), crumbs: JSON.stringify(bidRequest.crumbs), prebidVersion: '$prebid.version$', - version: 3, + version: 4, coppa: config.getConfig('coppa') == true ? 1 : 0, ccpa: bidderRequest.uspConsent || undefined } + if ( + bidderRequest && + bidderRequest.gppConsent && + bidderRequest.gppConsent.gppString + ) { + payload.gpp = bidderRequest.gppConsent.gppString; + payload.gppSid = bidderRequest.gppConsent.applicableSections; + } + return { method: 'GET', url: getBidRequestUrl(aimXR, bidRequest.params), @@ -74,6 +82,7 @@ export const spec = { const bidResponse = { requestId: response.bidid, + bidId: response.bidid, cpm: response.bid.price, currency: response.cur, width: response.bid.w, diff --git a/test/spec/modules/lassoBidAdapter_spec.js b/test/spec/modules/lassoBidAdapter_spec.js index 3695889aca0..ad4040c0452 100644 --- a/test/spec/modules/lassoBidAdapter_spec.js +++ b/test/spec/modules/lassoBidAdapter_spec.js @@ -126,6 +126,7 @@ describe('lassoBidAdapter', function () { it('should get the correct bid response', function () { let expectedResponse = { requestId: '123456789', + bidId: '123456789', cpm: 1, currency: 'USD', width: 728, From b37bacad16c29485418b52593961dc2184e03cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20Labat?= Date: Mon, 8 Apr 2024 18:58:28 +0200 Subject: [PATCH 2/8] Criteo Bid Adapter: Fix invalid DSA adrender field mapping (#11306) --- modules/criteoBidAdapter.js | 4 ++-- test/spec/modules/criteoBidAdapter_spec.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/criteoBidAdapter.js b/modules/criteoBidAdapter.js index c1fcac4ae2f..2c0cacb7909 100644 --- a/modules/criteoBidAdapter.js +++ b/modules/criteoBidAdapter.js @@ -255,8 +255,8 @@ export const spec = { if (slot.ext?.meta?.networkName) { bid.meta = Object.assign({}, bid.meta, { networkName: slot.ext.meta.networkName }) } - if (slot.ext?.dsa?.adrender) { - bid.meta = Object.assign({}, bid.meta, { adrender: slot.ext.dsa.adrender }) + if (slot.ext?.dsa) { + bid.meta = Object.assign({}, bid.meta, { dsa: slot.ext.dsa }) } if (slot.native) { if (bidRequest.params.nativeCallback) { diff --git a/test/spec/modules/criteoBidAdapter_spec.js b/test/spec/modules/criteoBidAdapter_spec.js index 1709acb465f..2cdb09f2098 100755 --- a/test/spec/modules/criteoBidAdapter_spec.js +++ b/test/spec/modules/criteoBidAdapter_spec.js @@ -2060,7 +2060,7 @@ describe('The Criteo bidding adapter', function () { }; const bids = spec.interpretResponse(response, request); expect(bids).to.have.lengthOf(1); - expect(bids[0].meta.adrender).to.equal(1); + expect(bids[0].meta.dsa.adrender).to.equal(1); }); it('should properly parse a bid response with a networkId with twin ad unit banner win', function () { From 7f93cb2ece1805fa3548ee65bd83ca9b066574bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=BCller?= Date: Mon, 8 Apr 2024 22:37:50 +0200 Subject: [PATCH 3/8] Agma Analytics Adapter: adds deviceHeight and deviceWidth to request (#11305) * Adds deviceHeight and deviceWidth to request * Increase internal version number --- modules/agmaAnalyticsAdapter.js | 5 ++++- test/spec/modules/agmaAnalyticsAdapter_spec.js | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/agmaAnalyticsAdapter.js b/modules/agmaAnalyticsAdapter.js index e43dee063c5..f3933cc7625 100644 --- a/modules/agmaAnalyticsAdapter.js +++ b/modules/agmaAnalyticsAdapter.js @@ -17,7 +17,7 @@ import { config } from '../src/config.js'; const GVLID = 1122; const ModuleCode = 'agma'; const analyticsType = 'endpoint'; -const scriptVersion = '1.7.1'; +const scriptVersion = '1.8.0'; const batchDelayInMs = 1000; const agmaURL = 'https://pbc.agma-analytics.de/v1'; const pageViewId = generateUUID(); @@ -127,6 +127,7 @@ export const getPayload = (auctionIds, options) => { }; if (useExtendedPayload) { + const device = config.getConfig('device') || {}; const { x, y } = getScreen(); const userIdsAsEids = getUserIDs(); payload = { @@ -141,6 +142,8 @@ export const getPayload = (auctionIds, options) => { pageUrl: ri.page, screenWidth: x, screenHeight: y, + deviceWidth: device.w || screen.width, + deviceHeight: device.h || screen.height, userIdsAsEids, }; } diff --git a/test/spec/modules/agmaAnalyticsAdapter_spec.js b/test/spec/modules/agmaAnalyticsAdapter_spec.js index ba71624e3b3..df18e7bcf45 100644 --- a/test/spec/modules/agmaAnalyticsAdapter_spec.js +++ b/test/spec/modules/agmaAnalyticsAdapter_spec.js @@ -28,6 +28,8 @@ const extendedKey = [ 'referrer', 'screenHeight', 'screenWidth', + 'deviceWidth', + 'deviceHeight', 'scriptVersion', 'timestamp', 'timezoneOffset', @@ -333,6 +335,8 @@ describe('AGMA Analytics Adapter', () => { expect(request.url).to.equal(INGEST_URL); expect(requestBody).to.have.all.keys(extendedKey); expect(requestBody.triggerEvent).to.equal(constants.EVENTS.AUCTION_INIT); + expect(requestBody.deviceWidth).to.equal(screen.width); + expect(requestBody.deviceHeight).to.equal(screen.height); expect(server.requests).to.have.length(1); expect(agmaAnalyticsAdapter.auctionIds).to.have.length(0); }); From 668c7c7bdc06ff3061da6aacb761b390f015009d Mon Sep 17 00:00:00 2001 From: JonGoSonobi Date: Tue, 9 Apr 2024 07:10:32 -0400 Subject: [PATCH 4/8] Remove the sending of experian rtd data through the fpd object (#11307) --- modules/sonobiBidAdapter.js | 12 +++++++----- test/spec/modules/sonobiBidAdapter_spec.js | 8 +++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index 1ce7665ddfc..f8e338484b2 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -98,9 +98,16 @@ export const spec = { 'iqid': bidderSettings.get(BIDDER_CODE, 'storageAllowed') ? JSON.stringify(loadOrCreateFirstPartyData()) : null, }; + if (deepAccess(bidderRequest, 'ortb2.experianRtidData') && deepAccess(bidderRequest, 'ortb2.experianRtidKey')) { + payload.expData = deepAccess(bidderRequest, 'ortb2.experianRtidData'); + payload.expKey = deepAccess(bidderRequest, 'ortb2.experianRtidKey'); + } + const fpd = bidderRequest.ortb2; if (fpd) { + delete fpd.experianRtidData; // Omit the experian data since we already pass this through a dedicated query param + delete fpd.experianRtidKey payload.fpd = JSON.stringify(fpd); } @@ -156,11 +163,6 @@ export const spec = { payload.coppa = 0; } - if (deepAccess(bidderRequest, 'ortb2.experianRtidData') && deepAccess(bidderRequest, 'ortb2.experianRtidKey')) { - payload.expData = deepAccess(bidderRequest, 'ortb2.experianRtidData'); - payload.expKey = deepAccess(bidderRequest, 'ortb2.experianRtidKey'); - } - // If there is no key_maker data, then don't make the request. if (isEmpty(data)) { return null; diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index 83db7c0a812..fb50a90333d 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -501,7 +501,13 @@ describe('SonobiBidAdapter', function () { const bidRequests = spec.buildRequests(bidRequest, bidderRequests) expect(bidRequests.data.expData).to.equal('IkhlbGxvLCB3b3JsZC4gSGVsbG8sIHdvcmxkLiBIZWxsbywgd29ybGQuIg=='); expect(bidRequests.data.expKey).to.equal('sovrn-encryption-key-1'); - }) + }); + + it('should return a properly formatted request with experianRtidData and exexperianRtidKeypKey omitted from fpd', function () { + const bidRequests = spec.buildRequests(bidRequest, bidderRequests) + expect(bidRequests.data.fpd.indexOf('experianRtidData')).to.equal(-1); + expect(bidRequests.data.fpd.indexOf('exexperianRtidKeypKey')).to.equal(-1); + }); it('should return null if there is nothing to bid on', function () { const bidRequests = spec.buildRequests([{ params: {} }], bidderRequests) From 4577159c0ec31896e5e0bd7654638861a265c189 Mon Sep 17 00:00:00 2001 From: CPG Date: Tue, 9 Apr 2024 13:24:22 +0200 Subject: [PATCH 5/8] Appnexus Bid Adapter: added emetriq as an alias (#11302) * Add "emetriq" as new "appnexus" alias * New Adapter: emetriq --- modules/appnexusBidAdapter.js | 1 + modules/sirdataRtdProvider.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index 590ad264515..5210d6f7562 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -111,6 +111,7 @@ export const spec = { aliases: [ { code: 'appnexusAst', gvlid: 32 }, { code: 'emxdigital', gvlid: 183 }, + { code: 'emetriq', gvlid: 213 }, { code: 'pagescience', gvlid: 32 }, { code: 'gourmetads', gvlid: 32 }, { code: 'matomy', gvlid: 32 }, diff --git a/modules/sirdataRtdProvider.js b/modules/sirdataRtdProvider.js index aaa3c48856b..97d0ec5219c 100644 --- a/modules/sirdataRtdProvider.js +++ b/modules/sirdataRtdProvider.js @@ -30,6 +30,7 @@ const partnerIds = { 'appnexus': 27446, 'appnexusAst': 27446, 'brealtime': 27446, + 'emetriq': 27446, 'emxdigital': 27446, 'pagescience': 27446, 'gourmetads': 33394, @@ -353,6 +354,7 @@ export function addSegmentData(reqBids, data, moduleConfig, onDone) { case 'appnexus': case 'appnexusAst': case 'brealtime': + case 'emetriq': case 'emxdigital': case 'pagescience': case 'gourmetads': From ca5162b18526b27d47f02d9b087772a0125e1852 Mon Sep 17 00:00:00 2001 From: Denis Logachov Date: Tue, 9 Apr 2024 17:05:53 +0300 Subject: [PATCH 6/8] Adkernel Bid Adapter: remove legacy native impl (#11291) --- modules/adkernelBidAdapter.js | 113 +++---------------- test/spec/modules/adkernelBidAdapter_spec.js | 74 ++++++++---- 2 files changed, 68 insertions(+), 119 deletions(-) diff --git a/modules/adkernelBidAdapter.js b/modules/adkernelBidAdapter.js index 491808f2602..ae02a8967b1 100644 --- a/modules/adkernelBidAdapter.js +++ b/modules/adkernelBidAdapter.js @@ -1,6 +1,5 @@ import { _each, - cleanObj, contains, createTrackPixelHtml, deepAccess, @@ -20,7 +19,6 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {find} from '../src/polyfill.js'; import {config} from '../src/config.js'; -import {convertOrtbRequestToProprietaryNative} from '../src/native.js'; import {getAdUnitSizes} from '../libraries/sizeUtils/sizeUtils.js'; /** @@ -39,7 +37,7 @@ const VIDEO_FPD = ['battr', 'pos']; const NATIVE_FPD = ['battr', 'api']; const BANNER_PARAMS = ['pos']; const BANNER_FPD = ['btype', 'battr', 'pos', 'api']; -const VERSION = '1.6'; +const VERSION = '1.7'; const SYNC_IFRAME = 1; const SYNC_IMAGE = 2; const SYNC_TYPES = { @@ -48,29 +46,6 @@ const SYNC_TYPES = { }; const GVLID = 14; -const NATIVE_MODEL = [ - {name: 'title', assetType: 'title'}, - {name: 'icon', assetType: 'img', type: 1}, - {name: 'image', assetType: 'img', type: 3}, - {name: 'body', assetType: 'data', type: 2}, - {name: 'body2', assetType: 'data', type: 10}, - {name: 'sponsoredBy', assetType: 'data', type: 1}, - {name: 'phone', assetType: 'data', type: 8}, - {name: 'address', assetType: 'data', type: 9}, - {name: 'price', assetType: 'data', type: 6}, - {name: 'salePrice', assetType: 'data', type: 7}, - {name: 'cta', assetType: 'data', type: 12}, - {name: 'rating', assetType: 'data', type: 3}, - {name: 'downloads', assetType: 'data', type: 5}, - {name: 'likes', assetType: 'data', type: 4}, - {name: 'displayUrl', assetType: 'data', type: 11} -]; - -const NATIVE_INDEX = NATIVE_MODEL.reduce((acc, val, idx) => { - acc[val.name] = {id: idx, ...val}; - return acc; -}, {}); - const MULTI_FORMAT_SUFFIX = '__mf'; const MULTI_FORMAT_SUFFIX_BANNER = 'b' + MULTI_FORMAT_SUFFIX; const MULTI_FORMAT_SUFFIX_VIDEO = 'v' + MULTI_FORMAT_SUFFIX; @@ -139,9 +114,6 @@ export const spec = { * @returns {ServerRequest[]} */ buildRequests: function (bidRequests, bidderRequest) { - // convert Native ORTB definition to old-style prebid native definition - bidRequests = convertOrtbRequestToProprietaryNative(bidRequests); - let impGroups = groupImpressionsByHostZone(bidRequests, bidderRequest.refererInfo); let requests = []; let schain = bidRequests[0].schain; @@ -199,7 +171,9 @@ export const spec = { prBid.height = imp.video.h; } else if ('native' in imp) { prBid.mediaType = NATIVE; - prBid.native = buildNativeAd(JSON.parse(rtbBid.adm)); + prBid.native = { + ortb: buildNativeAd(rtbBid.adm) + }; } if (isStr(rtbBid.dealid)) { prBid.dealId = rtbBid.dealid; @@ -345,11 +319,9 @@ function buildImps(bidRequest, secure) { } else { typedImp = imp; } - let nativeRequest = buildNativeRequest(mediaTypes.native); typedImp.native = { ...getDefinedParamsOrEmpty(bidRequest.ortb2Imp, NATIVE_FPD), - ver: '1.1', - request: JSON.stringify(nativeRequest) + request: JSON.stringify(bidRequest.nativeOrtbRequest) }; initImpBidfloor(typedImp, bidRequest, sizes, isMultiformat ? '*' : NATIVE); result.push(typedImp); @@ -371,51 +343,6 @@ function getDefinedParamsOrEmpty(object, params) { return getDefinedParams(object, params); } -/** - * Builds native request from native adunit - */ -function buildNativeRequest(nativeReq) { - let request = {ver: '1.1', assets: []}; - for (let k of Object.keys(nativeReq)) { - let v = nativeReq[k]; - let desc = NATIVE_INDEX[k]; - if (desc === undefined) { - continue; - } - let assetRoot = { - id: desc.id, - required: ~~v.required, - }; - if (desc.assetType === 'img') { - assetRoot[desc.assetType] = buildImageAsset(desc, v); - } else if (desc.assetType === 'data') { - assetRoot.data = cleanObj({type: desc.type, len: v.len}); - } else if (desc.assetType === 'title') { - assetRoot.title = {len: v.len || 90}; - } else { - return; - } - request.assets.push(assetRoot); - } - return request; -} - -/** - * Builds image asset request - */ -function buildImageAsset(desc, val) { - let img = { - type: desc.type - }; - if (val.sizes) { - [img.w, img.h] = val.sizes; - } else if (val.aspect_ratios) { - img.wmin = val.aspect_ratios[0].min_width; - img.hmin = val.aspect_ratios[0].min_height; - } - return cleanObj(img); -} - /** * Checks if configuration allows specified sync method * @param syncRule {Object} @@ -540,12 +467,11 @@ function makeRegulations(bidderRequest) { * @returns */ function makeBaseRequest(bidderRequest, imps, fpd) { - let {timeout} = bidderRequest; let request = { 'id': bidderRequest.bidderRequestId, 'imp': imps, 'at': 1, - 'tmax': parseInt(timeout) + 'tmax': parseInt(bidderRequest.timeout) }; if (!isEmpty(fpd.bcat)) { request.bcat = fpd.bcat; @@ -665,26 +591,15 @@ function validateNativeImageSize(img) { } /** - * Creates native ad for native 1.1 response + * Creates native ad for native 1.2 response */ -function buildNativeAd(nativeResp) { - const {assets, link, imptrackers, jstracker, privacy} = nativeResp.native; - let nativeAd = { - clickUrl: link.url, - impressionTrackers: imptrackers, - javascriptTrackers: jstracker ? [jstracker] : undefined, - privacyLink: privacy, - }; - _each(assets, asset => { - let assetName = NATIVE_MODEL[asset.id].name; - let assetType = NATIVE_MODEL[asset.id].assetType; - nativeAd[assetName] = asset[assetType].text || asset[assetType].value || cleanObj({ - url: asset[assetType].url, - width: asset[assetType].w, - height: asset[assetType].h - }); - }); - return cleanObj(nativeAd); +function buildNativeAd(adm) { + let resp = JSON.parse(adm); + // temporary workaround for top-level native object wrapper + if ('native' in resp) { + resp = resp.native; + } + return resp; } function stripMultiformatSuffix(impid) { diff --git a/test/spec/modules/adkernelBidAdapter_spec.js b/test/spec/modules/adkernelBidAdapter_spec.js index ade34478c20..cdfc9795b85 100644 --- a/test/spec/modules/adkernelBidAdapter_spec.js +++ b/test/spec/modules/adkernelBidAdapter_spec.js @@ -125,7 +125,8 @@ describe('Adkernel adapter', function () { bidId: 'Bid_01', bidderRequestId: 'req-001', auctionId: 'auc-001' - }, bid_native = { + }, + bid_native = { bidder: 'adkernel', params: {zoneId: 1, host: 'rtb.adkernel.com'}, mediaTypes: { @@ -171,6 +172,33 @@ describe('Adkernel adapter', function () { } } }, + nativeOrtbRequest: { + ver: '1.2', + assets: [ + { + id: 0, required: 1, title: {len: 80} + }, { + id: 1, required: 1, data: {type: 2}}, + { + id: 2, required: 1, data: {type: 10} + }, { + id: 3, required: 1, img: {type: 1, wmin: 50, hmin: 50} + }, { + id: 4, required: 1, img: {type: 3, w: 300, h: 200} + }, { + id: 5, required: 0, data: {type: 3} + }, { + id: 6, required: 0, data: {type: 6} + }, { + id: 7, required: 0, data: {type: 12} + }, { + id: 8, required: 0, data: {type: 1} + }, { + id: 9, required: 0, data: {type: 11} + } + ], + privacy: 1 + }, adUnitCode: 'ad-unit-1', transactionId: 'f82c64b8-c602-42a4-9791-4a268f6559ed', bidId: 'Bid_01', @@ -679,18 +707,18 @@ describe('Adkernel adapter', function () { expect(bidRequests[0].imp[0]).to.have.property('native'); expect(bidRequests[0].imp[0].native).to.have.property('request'); let request = JSON.parse(bidRequests[0].imp[0].native.request); - expect(request).to.have.property('ver', '1.1'); + expect(request).to.have.property('ver', '1.2'); expect(request.assets).to.have.length(10); expect(request.assets[0]).to.be.eql({id: 0, required: 1, title: {len: 80}}); - expect(request.assets[1]).to.be.eql({id: 3, required: 1, data: {type: 2}}); - expect(request.assets[2]).to.be.eql({id: 4, required: 1, data: {type: 10}}); - expect(request.assets[3]).to.be.eql({id: 1, required: 1, img: {wmin: 50, hmin: 50, type: 1}}); - expect(request.assets[4]).to.be.eql({id: 2, required: 1, img: {w: 300, h: 200, type: 3}}); - expect(request.assets[5]).to.be.eql({id: 11, required: 0, data: {type: 3}}); - expect(request.assets[6]).to.be.eql({id: 8, required: 0, data: {type: 6}}); - expect(request.assets[7]).to.be.eql({id: 10, required: 0, data: {type: 12}}); - expect(request.assets[8]).to.be.eql({id: 5, required: 0, data: {type: 1}}); - expect(request.assets[9]).to.be.eql({id: 14, required: 0, data: {type: 11}}); + expect(request.assets[1]).to.be.eql({id: 1, required: 1, data: {type: 2}}); + expect(request.assets[2]).to.be.eql({id: 2, required: 1, data: {type: 10}}); + expect(request.assets[3]).to.be.eql({id: 3, required: 1, img: {wmin: 50, hmin: 50, type: 1}}); + expect(request.assets[4]).to.be.eql({id: 4, required: 1, img: {w: 300, h: 200, type: 3}}); + expect(request.assets[5]).to.be.eql({id: 5, required: 0, data: {type: 3}}); + expect(request.assets[6]).to.be.eql({id: 6, required: 0, data: {type: 6}}); + expect(request.assets[7]).to.be.eql({id: 7, required: 0, data: {type: 12}}); + expect(request.assets[8]).to.be.eql({id: 8, required: 0, data: {type: 1}}); + expect(request.assets[9]).to.be.eql({id: 9, required: 0, data: {type: 11}}); }); it('native response processing', () => { @@ -707,15 +735,21 @@ describe('Adkernel adapter', function () { expect(resp.meta.secondaryCatIds).to.be.eql(['IAB1-4', 'IAB8-16', 'IAB25-5']); expect(resp).to.have.property('mediaType', NATIVE); expect(resp).to.have.property('native'); - expect(resp.native).to.have.property('clickUrl', 'http://rtb.com/click?i=pTuOlf5KHUo_0'); - expect(resp.native.impressionTrackers).to.be.eql(['http://rtb.com/win?i=pTuOlf5KHUo_0&f=imp']); - expect(resp.native).to.have.property('title', 'Title'); - expect(resp.native).to.have.property('body', 'Description'); - expect(resp.native).to.have.property('body2', 'Additional description'); - expect(resp.native.icon).to.be.eql({url: 'http://rtb.com/thumbnail?i=pTuOlf5KHUo_0&imgt=icon', width: 50, height: 50}); - expect(resp.native.image).to.be.eql({url: 'http://rtb.com/thumbnail?i=pTuOlf5KHUo_0', width: 300, height: 200}); - expect(resp.native).to.have.property('sponsoredBy', 'Sponsor.com'); - expect(resp.native).to.have.property('displayUrl', 'displayurl.com'); + expect(resp.native).to.have.property('ortb'); + + expect(resp.native.ortb).to.be.eql({ + assets: [ + {id: 0, title: {text: 'Title'}}, + {id: 3, data: {value: 'Description'}}, + {id: 4, data: {value: 'Additional description'}}, + {id: 1, img: {url: 'http://rtb.com/thumbnail?i=pTuOlf5KHUo_0&imgt=icon', w: 50, h: 50}}, + {id: 2, img: {url: 'http://rtb.com/thumbnail?i=pTuOlf5KHUo_0', w: 300, h: 200}}, + {id: 5, data: {value: 'Sponsor.com'}}, + {id: 14, data: {value: 'displayurl.com'}} + ], + link: {url: 'http://rtb.com/click?i=pTuOlf5KHUo_0'}, + imptrackers: ['http://rtb.com/win?i=pTuOlf5KHUo_0&f=imp'] + }); }); }); }); From db0b1bdc23fd89b94dbd43bad652d3997ed15b15 Mon Sep 17 00:00:00 2001 From: Nick Llerandi Date: Tue, 9 Apr 2024 11:19:52 -0400 Subject: [PATCH 7/8] refactors code for userIds; updates userId tests (#29) (#11298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: “Nick <“nick.llerandi”@kargo.com> --- modules/kargoBidAdapter.js | 41 ++++++++++++----------- test/spec/modules/kargoBidAdapter_spec.js | 36 ++++++++++++++++++++ 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/modules/kargoBidAdapter.js b/modules/kargoBidAdapter.js index e86d7022987..fe22915223e 100644 --- a/modules/kargoBidAdapter.js +++ b/modules/kargoBidAdapter.js @@ -359,56 +359,57 @@ function getUserIds(tdidAdapter, usp, gdpr, eids, gpp) { crbIDs: crb.syncIds || {} }; - // Pull Trade Desk ID from adapter - if (tdidAdapter) { - userIds.tdID = tdidAdapter; - } - - // Pull Trade Desk ID from our storage + // Pull Trade Desk ID if (!tdidAdapter && crb.tdID) { userIds.tdID = crb.tdID; + } else if (tdidAdapter) { + userIds.tdID = tdidAdapter; } + // USP if (usp) { userIds.usp = usp; } - try { - if (gdpr) { - userIds['gdpr'] = { - consent: gdpr.consentString || '', - applies: !!gdpr.gdprApplies, - } - } - } catch (e) { + // GDPR + if (gdpr) { + userIds.gdpr = { + consent: gdpr.consentString || '', + applies: !!gdpr.gdprApplies, + }; } + // Kargo ID if (crb.lexId != null) { userIds.kargoID = crb.lexId; } + // Client ID if (crb.clientId != null) { userIds.clientID = crb.clientId; } + // Opt Out if (crb.optOut != null) { userIds.optOut = crb.optOut; } + // User ID Sub-Modules (userIdAsEids) if (eids != null) { userIds.sharedIDEids = eids; } + // GPP if (gpp) { - const parsedGPP = {} - if (gpp && gpp.consentString) { - parsedGPP.gppString = gpp.consentString + const parsedGPP = {}; + if (gpp.consentString) { + parsedGPP.gppString = gpp.consentString; } - if (gpp && gpp.applicableSections) { - parsedGPP.applicableSections = gpp.applicableSections + if (gpp.applicableSections) { + parsedGPP.applicableSections = gpp.applicableSections; } if (!isEmpty(parsedGPP)) { - userIds.gpp = parsedGPP + userIds.gpp = parsedGPP; } } diff --git a/test/spec/modules/kargoBidAdapter_spec.js b/test/spec/modules/kargoBidAdapter_spec.js index 20a43d0397f..eb8f310201d 100644 --- a/test/spec/modules/kargoBidAdapter_spec.js +++ b/test/spec/modules/kargoBidAdapter_spec.js @@ -112,6 +112,24 @@ describe('kargo adapter tests', function () { } } ] + }, + { + 'source': 'adquery.io', + 'uids': [ + { + 'id': 'adqueryId-123', + 'atype': 1 + } + ] + }, + { + 'source': 'criteo.com', + 'uids': [ + { + 'id': 'criteoId-456', + 'atype': 1 + } + ] } ], floorData: { @@ -582,6 +600,24 @@ describe('kargo adapter tests', function () { } } ] + }, + { + source: 'adquery.io', + uids: [ + { + id: 'adqueryId-123', + atype: 1 + } + ] + }, + { + source: 'criteo.com', + uids: [ + { + id: 'criteoId-456', + atype: 1 + } + ] } ], data: [ From beeb9017b5a398eca4facb014e7db2f05825187d Mon Sep 17 00:00:00 2001 From: JonGoSonobi Date: Tue, 9 Apr 2024 16:04:11 -0400 Subject: [PATCH 8/8] Removed sending of experian data to Sonobi's bid endpoint (#11309) --- modules/sonobiBidAdapter.js | 5 ----- test/spec/modules/sonobiBidAdapter_spec.js | 8 -------- 2 files changed, 13 deletions(-) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index f8e338484b2..e1b51affd09 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -98,11 +98,6 @@ export const spec = { 'iqid': bidderSettings.get(BIDDER_CODE, 'storageAllowed') ? JSON.stringify(loadOrCreateFirstPartyData()) : null, }; - if (deepAccess(bidderRequest, 'ortb2.experianRtidData') && deepAccess(bidderRequest, 'ortb2.experianRtidKey')) { - payload.expData = deepAccess(bidderRequest, 'ortb2.experianRtidData'); - payload.expKey = deepAccess(bidderRequest, 'ortb2.experianRtidKey'); - } - const fpd = bidderRequest.ortb2; if (fpd) { diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index fb50a90333d..c7f954cfdcf 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -495,14 +495,6 @@ describe('SonobiBidAdapter', function () { expect(bidRequests.data.hfa).to.equal('hfakey') }) - it('should return a properly formatted request with expData and expKey', function () { - bidderRequests.ortb2.experianRtidData = 'IkhlbGxvLCB3b3JsZC4gSGVsbG8sIHdvcmxkLiBIZWxsbywgd29ybGQuIg=='; - bidderRequests.ortb2.experianRtidKey = 'sovrn-encryption-key-1'; - const bidRequests = spec.buildRequests(bidRequest, bidderRequests) - expect(bidRequests.data.expData).to.equal('IkhlbGxvLCB3b3JsZC4gSGVsbG8sIHdvcmxkLiBIZWxsbywgd29ybGQuIg=='); - expect(bidRequests.data.expKey).to.equal('sovrn-encryption-key-1'); - }); - it('should return a properly formatted request with experianRtidData and exexperianRtidKeypKey omitted from fpd', function () { const bidRequests = spec.buildRequests(bidRequest, bidderRequests) expect(bidRequests.data.fpd.indexOf('experianRtidData')).to.equal(-1);