From 084a0474cafaabb477f2abdae56b325c56033c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= Date: Wed, 12 Feb 2025 11:36:54 +0100 Subject: [PATCH 01/14] stx calling eqt endpoint --- modules/equativBidAdapter.js | 4 ++-- modules/sharethroughBidAdapter.js | 26 +++++++++++--------------- src/ajax.js | 6 ++++++ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/modules/equativBidAdapter.js b/modules/equativBidAdapter.js index 39c7ee94586..c90b55d7d3a 100644 --- a/modules/equativBidAdapter.js +++ b/modules/equativBidAdapter.js @@ -1,4 +1,3 @@ - import { getBidFloor } from '../libraries/equativUtils/equativUtils.js'; import { ortbConverter } from '../libraries/ortbConverter/converter.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; @@ -54,7 +53,8 @@ export const spec = { requests.push({ data, method: 'POST', - url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169', + // url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169', + url: 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169', }) }); diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 7144370dc9c..90cabca33a8 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -7,14 +7,10 @@ const VERSION = '4.3.0'; const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; -const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; +// const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; +const STR_ENDPOINT = 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169'; const IDENTIFIER_PREFIX = 'Sharethrough:'; -// this allows stubbing of utility function that is used internally by the sharethrough adapter -export const sharethroughInternal = { - getProtocol, -}; - export const sharethroughAdapterSpec = { code: BIDDER_CODE, supportedMediaTypes: [VIDEO, BANNER], @@ -25,9 +21,6 @@ export const sharethroughAdapterSpec = { const timeout = bidderRequest.timeout; const firstPartyData = bidderRequest.ortb2 || {}; - const nonHttp = sharethroughInternal.getProtocol().indexOf('http') < 0; - const secure = nonHttp || sharethroughInternal.getProtocol().indexOf('https') > -1; - const req = { id: generateUUID(), at: 1, @@ -65,6 +58,11 @@ export const sharethroughAdapterSpec = { test: 0, }; + req.site.publisher = { + id: bidRequests[0].params.pkey, + ...req.site.publisher + }; + if (bidderRequest.ortb2?.device?.ext?.cdep) { req.device.ext['cdep'] = bidderRequest.ortb2.device.ext.cdep; } @@ -77,6 +75,7 @@ export const sharethroughAdapterSpec = { req.user = nullish(firstPartyData.user, {}); if (!req.user.ext) req.user.ext = {}; req.user.ext.eids = bidRequests[0].userIdAsEids || []; + // req.user.buyeruid = '3717065797593749908'; if (bidderRequest.gdprConsent) { const gdprApplies = bidderRequest.gdprConsent.gdprApplies === true; @@ -88,6 +87,7 @@ export const sharethroughAdapterSpec = { if (bidderRequest.uspConsent) { req.regs.ext.us_privacy = bidderRequest.uspConsent; + req.regs.us_privacy = bidderRequest.uspConsent; } if (bidderRequest?.gppConsent?.gppString) { @@ -177,7 +177,7 @@ export const sharethroughAdapterSpec = { return { id: bidReq.bidId, tagid: String(bidReq.params.pkey), - secure: secure ? 1 : 0, + secure: 1, bidfloor: getBidRequestFloor(bidReq), ...impression, }; @@ -289,11 +289,7 @@ function getBidRequestFloor(bid) { floor = parseFloat(floorInfo.floor); } } - return floor !== null ? floor : bid.params.floor; -} - -function getProtocol() { - return window.location.protocol; + return floor !== null ? floor : 0; } // stub for ?? operator diff --git a/src/ajax.js b/src/ajax.js index 0178f95eadf..b5b476bc77e 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -37,6 +37,12 @@ export function toFetchRequest(url, data, options = {}) { } const headers = new Headers(options.customHeaders); headers.set(CTYPE, options.contentType || 'text/plain'); + + if (url == 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169') { + headers.set('x-eqtv-debug', '6708e3aeca04848e919e9c8c'); // banner + // headers.set('x-eqtv-debug', '679a44eb9d44a9f4fd5dc52c'); // native + } + const rqOpts = { method, headers From 2a4ca6d04133924484adfc6c30ba73862d61bae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= Date: Thu, 27 Feb 2025 08:59:23 +0100 Subject: [PATCH 02/14] dsp user sync --- modules/sharethroughBidAdapter.js | 45 ++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 90cabca33a8..925ed423823 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -7,8 +7,11 @@ const VERSION = '4.3.0'; const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; +const COOKIE_SYNC_ORIGIN = 'https://demo.smartadserver.com'; +const COOKIE_SYNC_URL = `${COOKIE_SYNC_ORIGIN}/shared/diff/templates/asset/csync.html`; // const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; const STR_ENDPOINT = 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169'; +// const STR_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; const IDENTIFIER_PREFIX = 'Sharethrough:'; export const sharethroughAdapterSpec = { @@ -192,6 +195,11 @@ export const sharethroughAdapterSpec = { ...req, imp: [impression], }, + options: { + customHeaders: { + 'X-Eqtv-Debug': '6708e3aeca04848e919e9c8c' + } + } }; }); }, @@ -260,11 +268,40 @@ export const sharethroughAdapterSpec = { } }, - getUserSyncs: (syncOptions, serverResponses) => { - const shouldCookieSync = - syncOptions.pixelEnabled && deepAccess(serverResponses, '0.body.cookieSyncUrls') !== undefined; + getUserSyncs: (syncOptions, serverResponses, gdprConsent) => { + let sync = []; + + if (syncOptions.iframeEnabled) { + if (gdprConsent?.gdprApplies) { + window.addEventListener('message', function handler(event) { + if (event.origin === COOKIE_SYNC_ORIGIN && event.data.action === 'getConsent') { + event.source.postMessage({ + action: 'consentResponse', + id: event.data.id, + consents: gdprConsent.vendorData.vendor.consents + }, event.origin); + + this.removeEventListener('message', handler); + } + }); + } + + sync.push({ + type: 'iframe', + url: COOKIE_SYNC_URL + '?dc=us&gdpr=' + (gdprConsent?.gdprApplies ? 1 : 0) + }); + } + + if (syncOptions.pixelEnabled && deepAccess(serverResponses, '0.body.cookieSyncUrls')) { + serverResponses[0].body.cookieSyncUrls.map((url) => + sync.push({ + type: 'image', + url + }) + ); + } - return shouldCookieSync ? serverResponses[0].body.cookieSyncUrls.map((url) => ({ type: 'image', url: url })) : []; + return sync; }, // Empty implementation for prebid core to be able to find it From 19d27fa37fa8955cd3132680d3bd7c8dab33a6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= Date: Wed, 30 Apr 2025 10:39:31 +0200 Subject: [PATCH 03/14] revert test changes --- src/ajax.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ajax.js b/src/ajax.js index 45d79582b9f..2606d3e136d 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -37,11 +37,6 @@ export function toFetchRequest(url, data, options = {}) { } const headers = new Headers(options.customHeaders); headers.set(CTYPE, options.contentType || 'text/plain'); - - if (url == 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169') { - headers.set('x-eqtv-debug', '6708e3aeca04848e919e9c8c'); // banner - // headers.set('x-eqtv-debug', '679a44eb9d44a9f4fd5dc52c'); // native - } const rqOpts = { method, From a0088b91cfd4bbe3b10c5279621030d6755335ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= Date: Wed, 21 May 2025 15:45:38 +0200 Subject: [PATCH 04/14] add publisherId param to test eqt endpoint --- libraries/equativUtils/equativUtils.js | 57 ++++++++ modules/equativBidAdapter.js | 71 ++------- modules/sharethroughBidAdapter.js | 191 ++++++++++++++++++------- 3 files changed, 206 insertions(+), 113 deletions(-) diff --git a/libraries/equativUtils/equativUtils.js b/libraries/equativUtils/equativUtils.js index bdcbdad2f33..3bcdd7131e0 100644 --- a/libraries/equativUtils/equativUtils.js +++ b/libraries/equativUtils/equativUtils.js @@ -3,6 +3,32 @@ import { deepAccess, isFn } from '../../src/utils.js'; const DEFAULT_FLOOR = 0.0; +/** + * Assigns values to new properties, removes temporary ones from an object + * and remove temporary default bidfloor of -1 + * @param {*} obj An object + * @param {string} key A name of the new property + * @param {string} tempKey A name of the temporary property to be removed + * @returns {*} An updated object + */ +export function cleanObject(obj, key, tempKey) { + const newObj = {}; + + for (const prop in obj) { + if (prop === key) { + if (Object.prototype.hasOwnProperty.call(obj, tempKey)) { + newObj[key] = obj[tempKey]; + } + } else if (prop !== tempKey) { + newObj[prop] = obj[prop]; + } + } + + newObj.bidfloor === -1 && delete newObj.bidfloor; + + return newObj; +} + /** * Get floors from Prebid Price Floors module * @@ -28,3 +54,34 @@ export function getBidFloor (bid, currency, mediaType) { return floors.length ? Math.min(...floors) : DEFAULT_FLOOR; } + +/** + * Returns a floor price provided by the Price Floors module or the floor price set in the publisher parameters + * @param {*} bid + * @param {string} mediaType A media type + * @param {number} width A width of the ad + * @param {number} height A height of the ad + * @param {string} currency A floor price currency + * @returns {number} Floor price + */ +export function getFloor(bid, mediaType, width, height, currency) { + return bid.getFloor?.({ currency, mediaType, size: [width, height] }) + .floor || bid.params.bidfloor || -1; +} + +/** + * Generates a 14-char string id + * @returns {string} + */ +export function makeId() { + const length = 14; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let counter = 0; + let str = ''; + + while (counter++ < length) { + str += characters.charAt(Math.floor(Math.random() * characters.length)); + } + + return str; +} diff --git a/modules/equativBidAdapter.js b/modules/equativBidAdapter.js index 6c7fa059b71..1056af7b0b2 100644 --- a/modules/equativBidAdapter.js +++ b/modules/equativBidAdapter.js @@ -1,4 +1,5 @@ import { ortbConverter } from '../libraries/ortbConverter/converter.js'; +import { cleanObject, getFloor, makeId } from '../libraries/equativUtils/equativUtils.js'; import { tryAppendQueryString } from '../libraries/urlUtils/urlUtils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; @@ -21,46 +22,6 @@ const PID_STORAGE_NAME = 'eqt_pid'; let nwid = 0; let impIdMap = {}; -/** - * Assigns values to new properties, removes temporary ones from an object - * and remove temporary default bidfloor of -1 - * @param {*} obj An object - * @param {string} key A name of the new property - * @param {string} tempKey A name of the temporary property to be removed - * @returns {*} An updated object - */ -function cleanObject(obj, key, tempKey) { - const newObj = {}; - - for (const prop in obj) { - if (prop === key) { - if (Object.prototype.hasOwnProperty.call(obj, tempKey)) { - newObj[key] = obj[tempKey]; - } - } else if (prop !== tempKey) { - newObj[prop] = obj[prop]; - } - } - - newObj.bidfloor === -1 && delete newObj.bidfloor; - - return newObj; -} - -/** - * Returns a floor price provided by the Price Floors module or the floor price set in the publisher parameters - * @param {*} bid - * @param {string} mediaType A media type - * @param {number} width A width of the ad - * @param {number} height A height of the ad - * @param {string} currency A floor price currency - * @returns {number} Floor price - */ -function getFloor(bid, mediaType, width, height, currency) { - return bid.getFloor?.({ currency, mediaType, size: [width, height] }) - .floor || bid.params.bidfloor || -1; -} - /** * Gets value of the local variable impIdMap * @returns {*} Value of impIdMap @@ -80,23 +41,6 @@ function isValid(bidReq) { return !(bidReq.mediaTypes.video && JSON.stringify(bidReq.mediaTypes.video) === '{}') && !(bidReq.mediaTypes.native && JSON.stringify(bidReq.mediaTypes.native) === '{}'); } -/** - * Generates a 14-char string id - * @returns {string} - */ -function makeId() { - const length = 14; - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - let counter = 0; - let str = ''; - - while (counter++ < length) { - str += characters.charAt(Math.floor(Math.random() * characters.length)); - } - - return str; -} - export const storage = getStorageManager({ bidderCode: BIDDER_CODE }); export const spec = { @@ -122,8 +66,15 @@ export const spec = { requests.push({ data, method: 'POST', - // url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169', - url: 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169', + url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169', + // url: 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169', + // options: { + // customHeaders: { + // 'X-Eqtv-Debug': '6708e3aeca04848e919e9c8c' // banner + // // 'X-Eqtv-Debug': '682c50e92634fafa0d974114' // native + // // 'X-Eqtv-Debug': '67c8545f9d44a9f4fd5de345' // video + // } + // } }) }); @@ -193,7 +144,7 @@ export const spec = { }); let url = tryAppendQueryString(COOKIE_SYNC_URL + '?', 'nwid', nwid); - url = tryAppendQueryString(url, 'gdpr', (gdprConsent.gdprApplies ? '1' : '0')); + url = tryAppendQueryString(url, 'gdpr', (gdprConsent?.gdprApplies ? '1' : '0')); return [{ type: 'iframe', url }]; } diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 925ed423823..c9cceffc011 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -1,22 +1,37 @@ -import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -import { BANNER, VIDEO } from '../src/mediaTypes.js'; +import { ortbConverter } from '../libraries/ortbConverter/converter.js'; +import { cleanObject, getFloor, makeId } from '../libraries/equativUtils/equativUtils.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; import { deepAccess, generateUUID, inIframe, isPlainObject, logWarn, mergeDeep } from '../src/utils.js'; const VERSION = '4.3.0'; const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; -const COOKIE_SYNC_ORIGIN = 'https://demo.smartadserver.com'; -const COOKIE_SYNC_URL = `${COOKIE_SYNC_ORIGIN}/shared/diff/templates/asset/csync.html`; -// const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; -const STR_ENDPOINT = 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169'; -// const STR_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; +// const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; +const EQT_ENDPOINT = 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169'; +const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; const IDENTIFIER_PREFIX = 'Sharethrough:'; +let impIdMap = {}; +let isEqtTest = null; + +// this allows stubbing of utility function that is used internally by the sharethrough adapter +export const sharethroughInternal = { + getProtocol, +}; + +export const converter = ortbConverter({ + context: { + netRevenue: true, + ttl: 360 + } +}); + export const sharethroughAdapterSpec = { code: BIDDER_CODE, - supportedMediaTypes: [VIDEO, BANNER], + supportedMediaTypes: [VIDEO, BANNER, NATIVE], gvlid: 80, isBidRequestValid: (bid) => !!bid.params.pkey, @@ -24,6 +39,9 @@ export const sharethroughAdapterSpec = { const timeout = bidderRequest.timeout; const firstPartyData = bidderRequest.ortb2 || {}; + const nonHttp = sharethroughInternal.getProtocol().indexOf('http') < 0; + const secure = nonHttp || sharethroughInternal.getProtocol().indexOf('https') > -1; + const req = { id: generateUUID(), at: 1, @@ -61,10 +79,13 @@ export const sharethroughAdapterSpec = { test: 0, }; - req.site.publisher = { - id: bidRequests[0].params.pkey, - ...req.site.publisher - }; + if (bidRequests[0].params.publisherId) { + isEqtTest = true; + req.site.publisher = { + id: bidRequests[0].params.publisherId, + ...req.site.publisher + }; + } if (bidderRequest.ortb2?.device?.ext?.cdep) { req.device.ext['cdep'] = bidderRequest.ortb2.device.ext.cdep; @@ -78,7 +99,6 @@ export const sharethroughAdapterSpec = { req.user = nullish(firstPartyData.user, {}); if (!req.user.ext) req.user.ext = {}; req.user.ext.eids = bidRequests[0].userIdAsEids || []; - // req.user.buyeruid = '3717065797593749908'; if (bidderRequest.gdprConsent) { const gdprApplies = bidderRequest.gdprConsent.gdprApplies === true; @@ -115,6 +135,7 @@ export const sharethroughAdapterSpec = { const gpid = deepAccess(bidReq, 'ortb2Imp.ext.gpid') || deepAccess(bidReq, 'ortb2Imp.ext.data.pbadslot'); if (gpid) impression.ext.gpid = gpid; + const nativeRequest = deepAccess(bidReq, 'mediaTypes.native'); const videoRequest = deepAccess(bidReq, 'mediaTypes.video'); if (bidderRequest.paapi?.enabled && bidReq.mediaTypes.banner) { @@ -160,13 +181,26 @@ export const sharethroughAdapterSpec = { h, }; - const propertiesToConsider = [ - 'api', 'battr', 'companionad', 'companiontype', 'delivery', 'linearity', 'maxduration', 'mimes', 'minduration', 'placement', 'playbackmethod', 'plcmt', 'protocols', 'skip', 'skipafter', 'skipmin', 'startdelay' - ] + let propertiesToConsider = [ + 'api', 'battr', 'companiontype', 'delivery', 'linearity', 'maxduration', 'mimes', 'minduration', 'placement', 'playbackmethod', 'plcmt', 'protocols', 'skip', 'skipafter', 'skipmin', 'startdelay' + ]; + + if (!isEqtTest) { + propertiesToConsider.push('companionad'); + } propertiesToConsider.forEach(propertyToConsider => { applyVideoProperty(propertyToConsider, videoRequest, impression); }); + } else if (isEqtTest && nativeRequest) { + const nativeImp = converter.toORTB({ + bidRequests: [bidReq], + bidderRequest + }); + + impression.native = { + ...nativeImp.imp[0].native + }; } else { impression.banner = { pos: deepAccess(bidReq, 'mediaTypes.banner.pos', 0), @@ -174,32 +208,94 @@ export const sharethroughAdapterSpec = { format: bidReq.sizes.map((size) => ({ w: +size[0], h: +size[1] })), }; const battr = deepAccess(bidReq, 'mediaTypes.banner.battr', null) || deepAccess(bidReq, 'ortb2Imp.banner.battr') - if (battr) impression.banner.battr = battr + if (battr) impression.banner.battr = battr; } + const tagid = isEqtTest ? bidReq.adUnitCode : String(bidReq.params.pkey); + return { id: bidReq.bidId, - tagid: String(bidReq.params.pkey), - secure: 1, + tagid, + secure: secure ? 1 : 0, bidfloor: getBidRequestFloor(bidReq), ...impression, }; }) .filter((imp) => !!imp); + const splitImps = []; + if (isEqtTest) { + const bid = bidRequests[0]; + const currency = config.getConfig('currency.adServerCurrency') || 'USD'; + + imps.forEach(item => { + const floorMap = {}; + + const updateFloorMap = (type, name, width = 0, height = 0) => { + const floor = getFloor(bid, type, width, height, currency); + + if (!floorMap[floor]) { + floorMap[floor] = { + ...item, + bidfloor: floor + }; + } + + if (!floorMap[floor][name]) { + floorMap[floor][name] = type === 'banner' ? { format: [] } : item[type]; + } + + if (type === 'banner') { + floorMap[floor][name].format.push({ w: width, h: height }); + } + }; + + if (item.banner?.format?.length) { + item.banner.format.forEach(format => updateFloorMap('banner', 'bannerTemp', format?.w, format?.h)); + } + + updateFloorMap('native', 'nativeTemp'); + updateFloorMap('video', 'videoTemp', item.video?.w, item.video?.h); + + Object.values(floorMap).forEach(obj => { + [ + ['banner', 'bannerTemp'], + ['native', 'nativeTemp'], + ['video', 'videoTemp'] + ].forEach(([name, tempName]) => obj = cleanObject(obj, name, tempName)); + + if (obj.banner || obj.video || obj.native) { + const id = makeId(); + impIdMap[id] = obj.id; + obj.id = id; + + if (obj.banner) { + obj.banner.pos = item.banner.pos; + obj.banner.topframe = item.banner.topframe; + } + + splitImps.push(obj); + } + }); + }); + } + + const hash = + '6708e3aeca04848e919e9c8c'; // banner + // '67ff7ea9b4590cf0ca852f94'; // banner + ttl + // '682c50e92634fafa0d974114'; // native + // '67c8545f9d44a9f4fd5de345'; // video + const options = isEqtTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; + return imps.map((impression) => { return { method: 'POST', - url: STR_ENDPOINT, + url: isEqtTest ? EQT_ENDPOINT : STR_ENDPOINT, data: { ...req, - imp: [impression], + imp: isEqtTest ? splitImps : [impression], }, - options: { - customHeaders: { - 'X-Eqtv-Debug': '6708e3aeca04848e919e9c8c' - } - } + ...options }; }); }, @@ -217,19 +313,21 @@ export const sharethroughAdapterSpec = { const fledgeAuctionEnabled = body.ext?.auctionConfigs; + const imp = req.data.imp[0]; + const bidsFromExchange = body.seatbid[0].bid.map((bid) => { // Spec: https://docs.prebid.org/dev-docs/bidder-adaptor.html#interpreting-the-response const response = { - requestId: bid.impid, + requestId: isEqtTest ? impIdMap[bid.impid] : bid.impid, width: +bid.w, height: +bid.h, cpm: +bid.price, creativeId: bid.crid, dealId: bid.dealid || null, - mediaType: req.data.imp[0].video ? VIDEO : BANNER, + mediaType: imp.video ? VIDEO : imp.native ? NATIVE : BANNER, currency: body.cur || 'USD', netRevenue: true, - ttl: 360, + ttl: typeof bid.exp === 'number' && bid.exp > 0 ? bid.exp : 360, ad: bid.adm, nurl: bid.nurl, meta: { @@ -253,12 +351,16 @@ export const sharethroughAdapterSpec = { if (response.mediaType === VIDEO) { response.ttl = 3600; response.vastXml = bid.adm; + } else if (response.mediaType === NATIVE) { + response.native = { + ortb: JSON.parse(bid.adm) + }; } return response; }); - if (fledgeAuctionEnabled) { + if (fledgeAuctionEnabled && !isEqtTest) { return { bids: bidsFromExchange, paapi: body.ext?.auctionConfigs || {}, @@ -268,32 +370,11 @@ export const sharethroughAdapterSpec = { } }, - getUserSyncs: (syncOptions, serverResponses, gdprConsent) => { + getUserSyncs: (syncOptions, serverResponses) => { let sync = []; - if (syncOptions.iframeEnabled) { - if (gdprConsent?.gdprApplies) { - window.addEventListener('message', function handler(event) { - if (event.origin === COOKIE_SYNC_ORIGIN && event.data.action === 'getConsent') { - event.source.postMessage({ - action: 'consentResponse', - id: event.data.id, - consents: gdprConsent.vendorData.vendor.consents - }, event.origin); - - this.removeEventListener('message', handler); - } - }); - } - - sync.push({ - type: 'iframe', - url: COOKIE_SYNC_URL + '?dc=us&gdpr=' + (gdprConsent?.gdprApplies ? 1 : 0) - }); - } - if (syncOptions.pixelEnabled && deepAccess(serverResponses, '0.body.cookieSyncUrls')) { - serverResponses[0].body.cookieSyncUrls.map((url) => + serverResponses[0].body.cookieSyncUrls.map((url) => sync.push({ type: 'image', url @@ -329,6 +410,10 @@ function getBidRequestFloor(bid) { return floor !== null ? floor : 0; } +function getProtocol() { + return window.location.protocol; +} + // stub for ?? operator function nullish(input, def) { return input === null || input === undefined ? def : input; From 231f82cea8d7a2d41a88192bd63f2be476ba71c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= <88041828+krzysztofequativ@users.noreply.github.com> Date: Wed, 21 May 2025 16:03:04 +0200 Subject: [PATCH 05/14] remove new line --- src/ajax.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ajax.js b/src/ajax.js index 2606d3e136d..913e753e2e3 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -37,7 +37,6 @@ export function toFetchRequest(url, data, options = {}) { } const headers = new Headers(options.customHeaders); headers.set(CTYPE, options.contentType || 'text/plain'); - const rqOpts = { method, headers From 3c7fae38656cc93c07de1d83ceb885a8f61e81d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= Date: Mon, 26 May 2025 11:18:21 +0200 Subject: [PATCH 06/14] fixes after dev test --- modules/equativBidAdapter.js | 2 +- modules/sharethroughBidAdapter.js | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/equativBidAdapter.js b/modules/equativBidAdapter.js index 1056af7b0b2..ae66d326690 100644 --- a/modules/equativBidAdapter.js +++ b/modules/equativBidAdapter.js @@ -67,7 +67,7 @@ export const spec = { data, method: 'POST', url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169', - // url: 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169', + // url: 'https://ssb.eqtv.dev/api/bid?callerId=169', // options: { // customHeaders: { // 'X-Eqtv-Debug': '6708e3aeca04848e919e9c8c' // banner diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index c9cceffc011..71227051457 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -10,12 +10,12 @@ const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; // const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; -const EQT_ENDPOINT = 'https://ssb-engine-argocd-dev.internal.smartadserver.com/api/bid?callerId=169'; +const EQT_ENDPOINT = 'https://ssb.eqtv.dev/api/bid?callerId=169'; const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; const IDENTIFIER_PREFIX = 'Sharethrough:'; -let impIdMap = {}; -let isEqtTest = null; +const impIdMap = {}; +let isEqtvTest = null; // this allows stubbing of utility function that is used internally by the sharethrough adapter export const sharethroughInternal = { @@ -80,7 +80,7 @@ export const sharethroughAdapterSpec = { }; if (bidRequests[0].params.publisherId) { - isEqtTest = true; + isEqtvTest = true; req.site.publisher = { id: bidRequests[0].params.publisherId, ...req.site.publisher @@ -181,18 +181,18 @@ export const sharethroughAdapterSpec = { h, }; - let propertiesToConsider = [ + const propertiesToConsider = [ 'api', 'battr', 'companiontype', 'delivery', 'linearity', 'maxduration', 'mimes', 'minduration', 'placement', 'playbackmethod', 'plcmt', 'protocols', 'skip', 'skipafter', 'skipmin', 'startdelay' ]; - if (!isEqtTest) { + if (!isEqtvTest) { propertiesToConsider.push('companionad'); } propertiesToConsider.forEach(propertyToConsider => { applyVideoProperty(propertyToConsider, videoRequest, impression); }); - } else if (isEqtTest && nativeRequest) { + } else if (isEqtvTest && nativeRequest) { const nativeImp = converter.toORTB({ bidRequests: [bidReq], bidderRequest @@ -207,11 +207,11 @@ export const sharethroughAdapterSpec = { topframe: inIframe() ? 0 : 1, format: bidReq.sizes.map((size) => ({ w: +size[0], h: +size[1] })), }; - const battr = deepAccess(bidReq, 'mediaTypes.banner.battr', null) || deepAccess(bidReq, 'ortb2Imp.banner.battr') + const battr = deepAccess(bidReq, 'mediaTypes.banner.battr', null) || deepAccess(bidReq, 'ortb2Imp.banner.battr'); if (battr) impression.banner.battr = battr; } - const tagid = isEqtTest ? bidReq.adUnitCode : String(bidReq.params.pkey); + const tagid = isEqtvTest ? bidReq.adUnitCode : String(bidReq.params.pkey); return { id: bidReq.bidId, @@ -224,7 +224,7 @@ export const sharethroughAdapterSpec = { .filter((imp) => !!imp); const splitImps = []; - if (isEqtTest) { + if (isEqtvTest) { const bid = bidRequests[0]; const currency = config.getConfig('currency.adServerCurrency') || 'USD'; @@ -285,15 +285,15 @@ export const sharethroughAdapterSpec = { // '67ff7ea9b4590cf0ca852f94'; // banner + ttl // '682c50e92634fafa0d974114'; // native // '67c8545f9d44a9f4fd5de345'; // video - const options = isEqtTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; + const options = isEqtvTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; return imps.map((impression) => { return { method: 'POST', - url: isEqtTest ? EQT_ENDPOINT : STR_ENDPOINT, + url: isEqtvTest ? EQT_ENDPOINT : STR_ENDPOINT, data: { ...req, - imp: isEqtTest ? splitImps : [impression], + imp: isEqtvTest ? splitImps : [impression], }, ...options }; @@ -318,7 +318,7 @@ export const sharethroughAdapterSpec = { const bidsFromExchange = body.seatbid[0].bid.map((bid) => { // Spec: https://docs.prebid.org/dev-docs/bidder-adaptor.html#interpreting-the-response const response = { - requestId: isEqtTest ? impIdMap[bid.impid] : bid.impid, + requestId: isEqtvTest ? impIdMap[bid.impid] : bid.impid, width: +bid.w, height: +bid.h, cpm: +bid.price, @@ -360,7 +360,7 @@ export const sharethroughAdapterSpec = { return response; }); - if (fledgeAuctionEnabled && !isEqtTest) { + if (fledgeAuctionEnabled && !isEqtvTest) { return { bids: bidsFromExchange, paapi: body.ext?.auctionConfigs || {}, From 5484dd399cb0788c7fea182118e3a132584546dd Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Mon, 9 Jun 2025 15:31:00 +0200 Subject: [PATCH 07/14] Add unit tests --- modules/sharethroughBidAdapter.js | 28 +- .../modules/sharethroughBidAdapter_spec.js | 436 +++++++++++++++++- 2 files changed, 456 insertions(+), 8 deletions(-) diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 71227051457..9f55301b8d3 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -17,6 +17,22 @@ const IDENTIFIER_PREFIX = 'Sharethrough:'; const impIdMap = {}; let isEqtvTest = null; +/** + * Gets value of the local variable impIdMap + * @returns {*} Value of impIdMap + */ +export function getImpIdMap() { + return impIdMap; +}; + +/** + * Sets value of the local variable isEqtvTest + * @param {*} value + */ +export function setIsEqtvTest(value) { + isEqtvTest = value; +} + // this allows stubbing of utility function that is used internally by the sharethrough adapter export const sharethroughInternal = { getProtocol, @@ -282,9 +298,9 @@ export const sharethroughAdapterSpec = { const hash = '6708e3aeca04848e919e9c8c'; // banner - // '67ff7ea9b4590cf0ca852f94'; // banner + ttl - // '682c50e92634fafa0d974114'; // native - // '67c8545f9d44a9f4fd5de345'; // video + // '67ff7ea9b4590cf0ca852f94'; // banner + ttl + // '682c50e92634fafa0d974114'; // native + // '67c8545f9d44a9f4fd5de345'; // video const options = isEqtvTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; return imps.map((impression) => { @@ -386,13 +402,13 @@ export const sharethroughAdapterSpec = { }, // Empty implementation for prebid core to be able to find it - onTimeout: (data) => {}, + onTimeout: (data) => { }, // Empty implementation for prebid core to be able to find it - onBidWon: (bid) => {}, + onBidWon: (bid) => { }, // Empty implementation for prebid core to be able to find it - onSetTargeting: (bid) => {}, + onSetTargeting: (bid) => { }, }; function getBidRequestFloor(bid) { diff --git a/test/spec/modules/sharethroughBidAdapter_spec.js b/test/spec/modules/sharethroughBidAdapter_spec.js index 0e0bc7fd14c..0640e50cf21 100644 --- a/test/spec/modules/sharethroughBidAdapter_spec.js +++ b/test/spec/modules/sharethroughBidAdapter_spec.js @@ -5,6 +5,7 @@ import { newBidder } from 'src/adapters/bidderFactory.js'; import { config } from 'src/config'; import * as utils from 'src/utils'; import { deepSetValue } from '../../../src/utils'; +import { getImpIdMap, setIsEqtvTest } from '../../../modules/sharethroughBidAdapter'; const spec = newBidder(sharethroughAdapterSpec).getSpec(); @@ -50,7 +51,135 @@ describe('sharethrough adapter spec', function () { }); describe('open rtb', () => { - let bidRequests, bidderRequest; + let bidRequests, bidderRequest, multiImpBidRequests; + + const bannerBidRequests = [ + { + adUnitCode: 'eqtv_42', + bidId: 'abcd1234', + sizes: [ + [300, 250], + [300, 600], + ], + mediaTypes: { + banner: { + sizes: [ + [300, 250], + [300, 600], + ], + }, + }, + bidder: 'equativ', + params: { + networkId: 111, + publisherId: 73 + }, + requestId: 'efgh5678', + ortb2Imp: { + ext: { + tid: 'zsfgzzg', + }, + }, + } + ]; + + const videoBidRequests = [ + { + adUnitCode: 'eqtv_43', + bidId: 'efgh5678', + sizes: [], + mediaTypes: { + video: { + context: 'instream', + playerSize: [[640, 480]], + pos: 3, + skip: 1, + linearity: 1, + minduration: 10, + maxduration: 30, + minbitrate: 300, + maxbitrate: 600, + w: 640, + h: 480, + playbackmethod: [1], + api: [3], + mimes: ['video/x-flv', 'video/mp4'], + startdelay: 42, + battr: [13, 14], + placement: 1, + }, + }, + bidder: 'equativ', + params: { + networkId: 111, + publisherId: 73 + }, + requestId: 'abcd1234', + ortb2Imp: { + ext: { + tid: 'zsgzgzz', + }, + }, + } + ]; + + const nativeOrtbRequest = { + assets: [{ + id: 0, + required: 1, + title: { + len: 140 + } + }, + { + id: 1, + required: 1, + img: { + type: 3, + w: 300, + h: 600 + } + }, + { + id: 2, + required: 1, + data: { + type: 1 + } + }], + context: 1, + eventtrackers: [{ + event: 1, + methods: [1, 2] + }], + plcmttype: 1, + privacy: 1, + ver: '1.2', + }; + + const nativeBidRequests = [{ + bidder: 'sharethrough', + adUnitCode: 'sharethrough_native_42', + bidId: 'bidId3', + sizes: [], + mediaTypes: { + native: { + ...nativeOrtbRequest + }, + }, + nativeOrtbRequest, + bidder: 'sharethrough', + params: { + networkId: 777, + publisherId: 73 + }, + requestId: 'sharethrough_native_reqid_42', + ortb2Imp: { + ext: { + tid: 'sharethrough_native_tid_42', + }, + }, + }] beforeEach(() => { config.setConfig({ @@ -241,6 +370,37 @@ describe('sharethrough adapter spec', function () { }, ]; + multiImpBidRequests = [ + { + adUnitCode: 'equativ_42', + bidId: 'abcd1234', + mediaTypes: { + banner: bannerBidRequests[0].mediaTypes.banner, + video: videoBidRequests[0].mediaTypes.video, + native: nativeBidRequests[0].mediaTypes.native + }, + sizes: [], + nativeOrtbRequest, + bidder: 'equativ', + params: { + networkId: 111, + publisherId: 73 + }, + requestId: 'efgh5678', + ortb2Imp: { + ext: { + tid: 'zsfgzzg', + }, + }, + getFloor: ({ mediaType, size }) => { + if ((mediaType === 'banner' && size[0] === 300 && size[1] === 250) || mediaType === 'native') { + return { floor: 1.1 }; + } + return { floor: 0.9 }; + } + } + ]; + bidderRequest = { refererInfo: { ref: 'https://referer.com', @@ -254,6 +414,10 @@ describe('sharethrough adapter spec', function () { }; }); + afterEach(() => { + setIsEqtvTest(null); + }) + describe('buildRequests', function () { describe('top level object', () => { it('should build openRTB request', () => { @@ -421,6 +585,7 @@ describe('sharethrough adapter spec', function () { const openRtbReq = spec.buildRequests(bidRequests, bidderRequest)[0].data; expect(openRtbReq.regs.ext.us_privacy).to.equal('consent'); + expect(openRtbReq.regs.us_privacy).to.equal('consent'); }); }); @@ -814,7 +979,7 @@ describe('sharethrough adapter spec', function () { const EXPECTED_AE_VALUE = 1; // ACT - bidderRequest.paapi = {enabled: true}; + bidderRequest.paapi = { enabled: true }; const builtRequests = spec.buildRequests(bidRequests, bidderRequest); const ACTUAL_AE_VALUE = builtRequests[0].data.imp[0].ext.ae; @@ -823,6 +988,105 @@ describe('sharethrough adapter spec', function () { expect(builtRequests[1].data.imp[0].ext.ae).to.be.undefined; }); }); + + describe('isEqtvTest', () => { + it('should set publisher id if publisherId param is present', () => { + const builtRequest = spec.buildRequests(multiImpBidRequests, bidderRequest)[0] + expect(builtRequest.data.site.publisher.id).to.equal(73) + }) + + it('should not set publisher id if publisherIdParam is not present', () => { + const bidRequest = { + ...bidRequests[0], + params: { + ...bidRequests[0].params, + publisherId: undefined + } + } + + const builtRequest = spec.buildRequests([bidRequest], bidderRequest)[0] + expect(builtRequest.data.site.publisher).to.equal(undefined) + }) + + it('should generate a 14-char id for each imp object', () => { + const request = spec.buildRequests( + bannerBidRequests, + bidderRequest + ); + + request[0].data.imp.forEach(imp => { + expect(imp.id).to.have.lengthOf(14); + }); + }); + + it('should split banner sizes per floor', () => { + const bids = [ + { + ...bannerBidRequests[0], + getFloor: ({ size }) => ({ floor: size[0] * size[1] / 100_000 }) + } + ]; + + const request = spec.buildRequests( + bids, + bidderRequest + ); + + expect(request[0].data.imp).to.have.lengthOf(2); + + const firstImp = request[0].data.imp[0]; + expect(firstImp.bidfloor).to.equal(300 * 250 / 100_000); + expect(firstImp.banner.format).to.have.lengthOf(1); + expect(firstImp.banner.format[0]).to.deep.equal({ w: 300, h: 250 }); + + const secondImp = request[0].data.imp[1]; + expect(secondImp.bidfloor).to.equal(300 * 600 / 100_000); + expect(secondImp.banner.format).to.have.lengthOf(1); + expect(secondImp.banner.format[0]).to.deep.equal({ w: 300, h: 600 }); + }); + + // it('should group media types per floor', () => { + // const request = spec.buildRequests( + // multiImpBidRequests, + // bidderRequest + // ); + + // const firstImp = request[0].data.imp[0]; + + // expect(firstImp.banner.format).to.have.lengthOf(1); + // expect(firstImp.banner.format[0]).to.deep.equal({ w: 300, h: 250 }); + // expect(firstImp).to.have.property('native'); + // expect(firstImp).to.not.have.property('video'); + + // const secondImp = request[0].data.imp[1]; + + // expect(secondImp.banner.format).to.have.lengthOf(1); + // expect(secondImp.banner.format[0]).to.deep.equal({ w: 300, h: 600 }); + // expect(secondImp).to.not.have.property('native'); + // expect(secondImp).to.have.property('video'); + // }); + }) + + it('should return correct native properties from ORTB converter', () => { + const request = spec.buildRequests(nativeBidRequests, bidderRequest)[0]; + const assets = JSON.parse(request.data.imp[0].native.request).assets; + + const asset1 = assets[0]; + expect(asset1.id).to.equal(0); + expect(asset1.required).to.equal(1); + expect(asset1.title).to.deep.equal({'len': 140}); + + const asset2 = assets[1]; + expect(asset2.id).to.equal(1); + expect(asset2.required).to.equal(1); + expect(asset2.img).to.deep.equal({'type': 3, 'w': 300, 'h': 600}); + + const asset3 = assets[2]; + expect(asset3.id).to.equal(2); + expect(asset3.required).to.equal(1); + expect(asset3.data).to.deep.equal({'type': 1}) + }) + }); describe('interpretResponse', function () { @@ -881,6 +1145,144 @@ describe('sharethrough adapter spec', function () { expect(bannerBid.meta.advertiserDomains).to.deep.equal(['domain.com']); expect(bannerBid.vastXml).to.be.undefined; }); + + it('should set requestId from impIdMap when isEqtvTest is true', () => { + setIsEqtvTest(true); + request = spec.buildRequests(bannerBidRequests, bidderRequest)[0] + response = { + body: { + seatbid: [ + { + bid: [ + { + id: 'abcd1234', + impid: 'aaaabbbbccccdd', + w: 300, + h: 250, + price: 42, + crid: 'creative', + dealid: 'deal', + adomain: ['domain.com'], + adm: 'markup', + }, + ], + }, + ], + }, + }; + + const impIdMap = getImpIdMap(); + impIdMap['aaaabbbbccccdd'] = 'abcd1234' + + const resp = spec.interpretResponse(response, request)[0]; + + expect(resp.requestId).to.equal('abcd1234') + }) + + it('should set ttl when bid.exp is a number > 0', () => { + request = spec.buildRequests(bannerBidRequests, bidderRequest)[0] + response = { + body: { + seatbid: [ + { + bid: [ + { + id: 'abcd1234', + impid: 'aaaabbbbccccdd', + w: 300, + h: 250, + price: 42, + crid: 'creative', + dealid: 'deal', + adomain: ['domain.com'], + adm: 'markup', + exp: 100 + }, + ], + }, + ], + }, + }; + + const resp = spec.interpretResponse(response, request)[0]; + expect(resp.ttl).to.equal(100); + }) + + it('should set ttl to 360 when bid.exp is a number <= 0', () => { + request = spec.buildRequests(bannerBidRequests, bidderRequest)[0] + response = { + body: { + seatbid: [ + { + bid: [ + { + id: 'abcd1234', + impid: 'aaaabbbbccccdd', + w: 300, + h: 250, + price: 42, + crid: 'creative', + dealid: 'deal', + adomain: ['domain.com'], + adm: 'markup', + exp: -1 + }, + ], + }, + ], + }, + }; + + const resp = spec.interpretResponse(response, request)[0]; + expect(resp.ttl).to.equal(360); + }) + + it('should return correct properties when fledgeAuctionEnabled is true and isEqtvTest is false', () => { + request = spec.buildRequests(bidRequests, bidderRequest)[0] + response = { + body: { + ext: { + auctionConfigs: { + key: 'value' + } + }, + seatbid: [ + { + bid: [ + { + id: 'abcd1234', + impid: 'aaaabbbbccccdd', + w: 300, + h: 250, + price: 42, + crid: 'creative', + dealid: 'deal', + adomain: ['domain.com'], + adm: 'markup', + exp: -1 + }, + { + id: 'efgh5678', + impid: 'ddeeeeffffgggg', + w: 300, + h: 250, + price: 42, + crid: 'creative', + dealid: 'deal', + adomain: ['domain.com'], + adm: 'markup', + exp: -1 + }, + ], + }, + ], + }, + }; + + const resp = spec.interpretResponse(response, request); + expect(resp.bids.length).to.equal(2); + expect(resp.paapi).to.deep.equal({'key': 'value'}) + }) }); describe('video', () => { @@ -926,6 +1328,36 @@ describe('sharethrough adapter spec', function () { }); }); + describe('native', () => { + beforeEach(() => { + request = spec.buildRequests(nativeBidRequests, bidderRequest)[0]; + response = { + body: { + seatbid: [ + { + bid: [ + { + id: '456', + impid: 'bidId2', + w: 640, + h: 480, + price: 42, + adm: '{"ad": "ad"}', + }, + ], + }, + ], + }, + }; + }); + + it('should set correct ortb property', () => { + const resp = spec.interpretResponse(response, request)[0]; + + expect(resp.native.ortb).to.deep.equal({ 'ad': 'ad' }) + }) + }) + describe('meta object', () => { beforeEach(() => { request = spec.buildRequests(bidRequests, bidderRequest)[0]; From f75d3d2accbd583b0b59881be557ccc1ff860c54 Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Tue, 10 Jun 2025 08:33:04 +0200 Subject: [PATCH 08/14] Comment test data. Fix linter issues --- modules/equativBidAdapter.js | 1 - modules/sharethroughBidAdapter.js | 18 +++++++++--------- .../modules/sharethroughBidAdapter_spec.js | 2 -- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/equativBidAdapter.js b/modules/equativBidAdapter.js index 8cc6420d85b..c04fadd1a81 100644 --- a/modules/equativBidAdapter.js +++ b/modules/equativBidAdapter.js @@ -107,7 +107,6 @@ export const spec = { // // 'X-Eqtv-Debug': '67c8545f9d44a9f4fd5de345' // video // } // }, - url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169' }) }); diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 9f55301b8d3..07ed74c41d7 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -9,8 +9,8 @@ const VERSION = '4.3.0'; const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; -// const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; -const EQT_ENDPOINT = 'https://ssb.eqtv.dev/api/bid?callerId=169'; +const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; +// const EQT_ENDPOINT = 'https://ssb.eqtv.dev/api/bid?callerId=169'; const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; const IDENTIFIER_PREFIX = 'Sharethrough:'; @@ -296,12 +296,13 @@ export const sharethroughAdapterSpec = { }); } - const hash = - '6708e3aeca04848e919e9c8c'; // banner - // '67ff7ea9b4590cf0ca852f94'; // banner + ttl - // '682c50e92634fafa0d974114'; // native - // '67c8545f9d44a9f4fd5de345'; // video - const options = isEqtvTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; + // test data + // const hash = + // '6708e3aeca04848e919e9c8c'; // banner + // // '67ff7ea9b4590cf0ca852f94'; // banner + ttl + // // '682c50e92634fafa0d974114'; // native + // // '67c8545f9d44a9f4fd5de345'; // video + // const options = isEqtvTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; return imps.map((impression) => { return { @@ -311,7 +312,6 @@ export const sharethroughAdapterSpec = { ...req, imp: isEqtvTest ? splitImps : [impression], }, - ...options }; }); }, diff --git a/test/spec/modules/sharethroughBidAdapter_spec.js b/test/spec/modules/sharethroughBidAdapter_spec.js index 0640e50cf21..d6f35127dbd 100644 --- a/test/spec/modules/sharethroughBidAdapter_spec.js +++ b/test/spec/modules/sharethroughBidAdapter_spec.js @@ -168,7 +168,6 @@ describe('sharethrough adapter spec', function () { }, }, nativeOrtbRequest, - bidder: 'sharethrough', params: { networkId: 777, publisherId: 73 @@ -1086,7 +1085,6 @@ describe('sharethrough adapter spec', function () { expect(asset3.required).to.equal(1); expect(asset3.data).to.deep.equal({'type': 1}) }) - }); describe('interpretResponse', function () { From 4dbf2ae3020d6a48aeeb03863014be382f26d082 Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Tue, 10 Jun 2025 11:24:14 +0200 Subject: [PATCH 09/14] Remove test data. Move duplicated code --- libraries/equativUtils/equativUtils.js | 77 ++++++++++++++++++++++++-- modules/equativBidAdapter.js | 57 +------------------ modules/sharethroughBidAdapter.js | 65 +--------------------- 3 files changed, 78 insertions(+), 121 deletions(-) diff --git a/libraries/equativUtils/equativUtils.js b/libraries/equativUtils/equativUtils.js index 3bcdd7131e0..70b1e5ad69c 100644 --- a/libraries/equativUtils/equativUtils.js +++ b/libraries/equativUtils/equativUtils.js @@ -11,7 +11,7 @@ const DEFAULT_FLOOR = 0.0; * @param {string} tempKey A name of the temporary property to be removed * @returns {*} An updated object */ -export function cleanObject(obj, key, tempKey) { +function cleanObject(obj, key, tempKey) { const newObj = {}; for (const prop in obj) { @@ -37,7 +37,7 @@ export function cleanObject(obj, key, tempKey) { * @param {string} mediaType Bid media type * @return {number} Floor price */ -export function getBidFloor (bid, currency, mediaType) { +export function getBidFloor(bid, currency, mediaType) { const floors = []; if (isFn(bid.getFloor)) { @@ -64,7 +64,7 @@ export function getBidFloor (bid, currency, mediaType) { * @param {string} currency A floor price currency * @returns {number} Floor price */ -export function getFloor(bid, mediaType, width, height, currency) { +function getFloor(bid, mediaType, width, height, currency) { return bid.getFloor?.({ currency, mediaType, size: [width, height] }) .floor || bid.params.bidfloor || -1; } @@ -73,7 +73,7 @@ export function getFloor(bid, mediaType, width, height, currency) { * Generates a 14-char string id * @returns {string} */ -export function makeId() { +function makeId() { const length = 14; const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let counter = 0; @@ -85,3 +85,72 @@ export function makeId() { return str; } + + +/** + * Prepares impressions for the request + * + * @export + * @param {*} imps An imps array + * @param {*} bid A bid + * @param {string} currency A currency + * @param {*} impIdMap An impIdMap + * @param {string} adapter An adapter (may be 'stx' or 'eqtv') + * @return {*} + */ +export function prepareSplitImps(imps, bid, currency, impIdMap, adapter) { + const splitImps = []; + + imps.forEach(item => { + const floorMap = {}; + + const updateFloorMap = (type, name, width = 0, height = 0) => { + const floor = getFloor(bid, type, width, height, currency); + + if (!floorMap[floor]) { + floorMap[floor] = { + ...item, + bidfloor: floor + }; + } + + if (!floorMap[floor][name]) { + floorMap[floor][name] = type === 'banner' ? { format: [] } : item[type]; + } + + if (type === 'banner') { + floorMap[floor][name].format.push({ w: width, h: height }); + } + }; + + if (item.banner?.format?.length) { + item.banner.format.forEach(format => updateFloorMap('banner', 'bannerTemp', format?.w, format?.h)); + } + + updateFloorMap('native', 'nativeTemp'); + updateFloorMap('video', 'videoTemp', item.video?.w, item.video?.h); + + Object.values(floorMap).forEach(obj => { + [ + ['banner', 'bannerTemp'], + ['native', 'nativeTemp'], + ['video', 'videoTemp'] + ].forEach(([name, tempName]) => obj = cleanObject(obj, name, tempName)); + + if (obj.banner || obj.video || obj.native) { + const id = makeId(); + impIdMap[id] = obj.id; + obj.id = id; + + if (obj.banner && adapter === 'stx') { + obj.banner.pos = item.banner.pos; + obj.banner.topframe = item.banner.topframe; + } + + splitImps.push(obj); + } + }); + }); + + return splitImps; +} diff --git a/modules/equativBidAdapter.js b/modules/equativBidAdapter.js index c04fadd1a81..dddd423b6f4 100644 --- a/modules/equativBidAdapter.js +++ b/modules/equativBidAdapter.js @@ -1,5 +1,5 @@ import { ortbConverter } from '../libraries/ortbConverter/converter.js'; -import { cleanObject, getFloor, makeId } from '../libraries/equativUtils/equativUtils.js'; +import { prepareSplitImps } from '../libraries/equativUtils/equativUtils.js'; import { tryAppendQueryString } from '../libraries/urlUtils/urlUtils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; @@ -99,14 +99,6 @@ export const spec = { data, method: 'POST', url: 'https://ssb-global.smartadserver.com/api/bid?callerId=169', - // url: 'https://ssb.eqtv.dev/api/bid?callerId=169', - // options: { - // customHeaders: { - // 'X-Eqtv-Debug': '6708e3aeca04848e919e9c8c' // banner - // // 'X-Eqtv-Debug': '682c50e92634fafa0d974114' // native - // // 'X-Eqtv-Debug': '67c8545f9d44a9f4fd5de345' // video - // } - // }, }) }); @@ -220,52 +212,7 @@ export const converter = ortbConverter({ request(buildRequest, imps, bidderRequest, context) { const bid = context.bidRequests[0]; const currency = config.getConfig('currency.adServerCurrency') || 'USD'; - const splitImps = []; - - imps.forEach(item => { - const floorMap = {}; - - const updateFloorMap = (type, name, width = 0, height = 0) => { - const floor = getFloor(bid, type, width, height, currency); - - if (!floorMap[floor]) { - floorMap[floor] = { - ...item, - bidfloor: floor - }; - } - - if (!floorMap[floor][name]) { - floorMap[floor][name] = type === 'banner' ? { format: [] } : item[type]; - } - - if (type === 'banner') { - floorMap[floor][name].format.push({ w: width, h: height }); - } - }; - - if (item.banner?.format?.length) { - item.banner.format.forEach(format => updateFloorMap('banner', 'bannerTemp', format?.w, format?.h)); - } - updateFloorMap('native', 'nativeTemp'); - updateFloorMap('video', 'videoTemp', item.video?.w, item.video?.h); - - Object.values(floorMap).forEach(obj => { - [ - ['banner', 'bannerTemp'], - ['native', 'nativeTemp'], - ['video', 'videoTemp'] - ].forEach(([name, tempName]) => obj = cleanObject(obj, name, tempName)); - - if (obj.banner || obj.video || obj.native) { - const id = makeId(); - impIdMap[id] = obj.id; - obj.id = id; - - splitImps.push(obj); - } - }); - }); + const splitImps = prepareSplitImps(imps, bid, currency, impIdMap, 'eqtv'); let req = buildRequest(splitImps, bidderRequest, context); diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 07ed74c41d7..57db42636f2 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -1,7 +1,7 @@ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; import { ortbConverter } from '../libraries/ortbConverter/converter.js'; -import { cleanObject, getFloor, makeId } from '../libraries/equativUtils/equativUtils.js'; +import { prepareSplitImps } from '../libraries/equativUtils/equativUtils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { deepAccess, generateUUID, inIframe, isPlainObject, logWarn, mergeDeep } from '../src/utils.js'; @@ -10,7 +10,6 @@ const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; -// const EQT_ENDPOINT = 'https://ssb.eqtv.dev/api/bid?callerId=169'; const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; const IDENTIFIER_PREFIX = 'Sharethrough:'; @@ -239,71 +238,13 @@ export const sharethroughAdapterSpec = { }) .filter((imp) => !!imp); - const splitImps = []; + let splitImps = [] if (isEqtvTest) { const bid = bidRequests[0]; const currency = config.getConfig('currency.adServerCurrency') || 'USD'; - - imps.forEach(item => { - const floorMap = {}; - - const updateFloorMap = (type, name, width = 0, height = 0) => { - const floor = getFloor(bid, type, width, height, currency); - - if (!floorMap[floor]) { - floorMap[floor] = { - ...item, - bidfloor: floor - }; - } - - if (!floorMap[floor][name]) { - floorMap[floor][name] = type === 'banner' ? { format: [] } : item[type]; - } - - if (type === 'banner') { - floorMap[floor][name].format.push({ w: width, h: height }); - } - }; - - if (item.banner?.format?.length) { - item.banner.format.forEach(format => updateFloorMap('banner', 'bannerTemp', format?.w, format?.h)); - } - - updateFloorMap('native', 'nativeTemp'); - updateFloorMap('video', 'videoTemp', item.video?.w, item.video?.h); - - Object.values(floorMap).forEach(obj => { - [ - ['banner', 'bannerTemp'], - ['native', 'nativeTemp'], - ['video', 'videoTemp'] - ].forEach(([name, tempName]) => obj = cleanObject(obj, name, tempName)); - - if (obj.banner || obj.video || obj.native) { - const id = makeId(); - impIdMap[id] = obj.id; - obj.id = id; - - if (obj.banner) { - obj.banner.pos = item.banner.pos; - obj.banner.topframe = item.banner.topframe; - } - - splitImps.push(obj); - } - }); - }); + splitImps = prepareSplitImps(imps, bid, currency, impIdMap, 'stx'); } - // test data - // const hash = - // '6708e3aeca04848e919e9c8c'; // banner - // // '67ff7ea9b4590cf0ca852f94'; // banner + ttl - // // '682c50e92634fafa0d974114'; // native - // // '67c8545f9d44a9f4fd5de345'; // video - // const options = isEqtvTest ? { options: { customHeaders: { 'X-Eqtv-Debug': hash } } } : undefined; - return imps.map((impression) => { return { method: 'POST', From 8d7350e49caa3ac2127ae515dad70cc4a387743a Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Wed, 11 Jun 2025 08:50:06 +0200 Subject: [PATCH 10/14] Fix linter issue --- libraries/equativUtils/equativUtils.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/equativUtils/equativUtils.js b/libraries/equativUtils/equativUtils.js index 70b1e5ad69c..4f0c7b99cab 100644 --- a/libraries/equativUtils/equativUtils.js +++ b/libraries/equativUtils/equativUtils.js @@ -90,12 +90,11 @@ function makeId() { /** * Prepares impressions for the request * - * @export * @param {*} imps An imps array * @param {*} bid A bid * @param {string} currency A currency * @param {*} impIdMap An impIdMap - * @param {string} adapter An adapter (may be 'stx' or 'eqtv') + * @param {string} adapter A type of adapter (may be 'stx' or 'eqtv') * @return {*} */ export function prepareSplitImps(imps, bid, currency, impIdMap, adapter) { From 8804d7981c820820ba5d50e02f91d1cfc95ecf97 Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Wed, 11 Jun 2025 15:22:56 +0200 Subject: [PATCH 11/14] Update calledId --- modules/sharethroughBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 57db42636f2..0d907612734 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -9,7 +9,7 @@ const VERSION = '4.3.0'; const BIDDER_CODE = 'sharethrough'; const SUPPLY_ID = 'WYu2BXv1'; -const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=169'; +const EQT_ENDPOINT = 'https://ssb.smartadserver.com/api/bid?callerId=233'; const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; const IDENTIFIER_PREFIX = 'Sharethrough:'; From 6679f68c39825032bd4c73da841f66bbf79319cc Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Fri, 13 Jun 2025 08:23:41 +0200 Subject: [PATCH 12/14] Fix native test --- .../modules/sharethroughBidAdapter_spec.js | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/test/spec/modules/sharethroughBidAdapter_spec.js b/test/spec/modules/sharethroughBidAdapter_spec.js index d6f35127dbd..a08966d8ab2 100644 --- a/test/spec/modules/sharethroughBidAdapter_spec.js +++ b/test/spec/modules/sharethroughBidAdapter_spec.js @@ -1067,23 +1067,25 @@ describe('sharethrough adapter spec', function () { }) it('should return correct native properties from ORTB converter', () => { - const request = spec.buildRequests(nativeBidRequests, bidderRequest)[0]; - const assets = JSON.parse(request.data.imp[0].native.request).assets; - - const asset1 = assets[0]; - expect(asset1.id).to.equal(0); - expect(asset1.required).to.equal(1); - expect(asset1.title).to.deep.equal({'len': 140}); - - const asset2 = assets[1]; - expect(asset2.id).to.equal(1); - expect(asset2.required).to.equal(1); - expect(asset2.img).to.deep.equal({'type': 3, 'w': 300, 'h': 600}); - - const asset3 = assets[2]; - expect(asset3.id).to.equal(2); - expect(asset3.required).to.equal(1); - expect(asset3.data).to.deep.equal({'type': 1}) + if (FEATURES.NATIVE) { + const request = spec.buildRequests(nativeBidRequests, {})[0]; + const assets = JSON.parse(request.data.imp[0].native.request).assets; + + const asset1 = assets[0]; + expect(asset1.id).to.equal(0); + expect(asset1.required).to.equal(1); + expect(asset1.title).to.deep.equal({ 'len': 140 }); + + const asset2 = assets[1]; + expect(asset2.id).to.equal(1); + expect(asset2.required).to.equal(1); + expect(asset2.img).to.deep.equal({ 'type': 3, 'w': 300, 'h': 600 }); + + const asset3 = assets[2]; + expect(asset3.id).to.equal(2); + expect(asset3.required).to.equal(1); + expect(asset3.data).to.deep.equal({ 'type': 1 }) + } }) }); @@ -1279,7 +1281,7 @@ describe('sharethrough adapter spec', function () { const resp = spec.interpretResponse(response, request); expect(resp.bids.length).to.equal(2); - expect(resp.paapi).to.deep.equal({'key': 'value'}) + expect(resp.paapi).to.deep.equal({ 'key': 'value' }) }) }); From b1a0bd95d1cc111c427f0e1cb46d5104ddb875a5 Mon Sep 17 00:00:00 2001 From: Krzysztof SIEG Date: Fri, 13 Jun 2025 14:17:52 +0200 Subject: [PATCH 13/14] Restore getUserSync. Add UT for equativUtils.js --- modules/sharethroughBidAdapter.js | 14 ++---- .../equativUtils/equativUtils_spec.js | 43 +++++++++++++++++++ 2 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 test/spec/libraries/equativUtils/equativUtils_spec.js diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 0d907612734..91afe107cdc 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -328,18 +328,10 @@ export const sharethroughAdapterSpec = { }, getUserSyncs: (syncOptions, serverResponses) => { - let sync = []; - - if (syncOptions.pixelEnabled && deepAccess(serverResponses, '0.body.cookieSyncUrls')) { - serverResponses[0].body.cookieSyncUrls.map((url) => - sync.push({ - type: 'image', - url - }) - ); - } + const shouldCookieSync = + syncOptions.pixelEnabled && deepAccess(serverResponses, '0.body.cookieSyncUrls') !== undefined; - return sync; + return shouldCookieSync ? serverResponses[0].body.cookieSyncUrls.map((url) => ({ type: 'image', url: url })) : []; }, // Empty implementation for prebid core to be able to find it diff --git a/test/spec/libraries/equativUtils/equativUtils_spec.js b/test/spec/libraries/equativUtils/equativUtils_spec.js new file mode 100644 index 00000000000..3056042b2f3 --- /dev/null +++ b/test/spec/libraries/equativUtils/equativUtils_spec.js @@ -0,0 +1,43 @@ +import * as equativUtils from "../../../../libraries/equativUtils/equativUtils"; + +describe('equativUtils', () => { + describe('prepareSplitImps', () => { + let imp, bid; + + beforeEach(() => { + imp = { + id: 'abcd1234', + banner: { + topframe: 1, + pos: 1, + format: [ + { + w: 10, + h: 10, + } + ] + }, + } + + bid = { + params: { + bidfloor: 2.0 + } + } + }) + + it('should not set pos and topframe properties for imp in case of Equativ adapter', () => { + const result = equativUtils.prepareSplitImps([imp], bid, 'USD', {}, 'eqtv')[0]; + + expect(result.banner.pos).to.be.undefined; + expect(result.banner.topframe).to.be.undefined; + }) + + it('should set pos and topframe properties for imp in case of Sharethrough adapter', () => { + const result = equativUtils.prepareSplitImps([imp], bid, 'USD', {}, 'stx')[0]; + + expect(result.banner.pos).to.equal(1); + expect(result.banner.topframe).to.equal(1); + }) + }) +}) From 674f89702e2dc3fa992937ee41a876e087b8ef47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Sok=C3=B3=C5=82?= Date: Fri, 20 Jun 2025 15:22:10 +0200 Subject: [PATCH 14/14] change optional param name --- modules/sharethroughBidAdapter.js | 4 +-- .../modules/sharethroughBidAdapter_spec.js | 28 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 91afe107cdc..0f348c31148 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -94,10 +94,10 @@ export const sharethroughAdapterSpec = { test: 0, }; - if (bidRequests[0].params.publisherId) { + if (bidRequests[0].params.equativNetworkId) { isEqtvTest = true; req.site.publisher = { - id: bidRequests[0].params.publisherId, + id: bidRequests[0].params.equativNetworkId, ...req.site.publisher }; } diff --git a/test/spec/modules/sharethroughBidAdapter_spec.js b/test/spec/modules/sharethroughBidAdapter_spec.js index a08966d8ab2..b1aa707cb0d 100644 --- a/test/spec/modules/sharethroughBidAdapter_spec.js +++ b/test/spec/modules/sharethroughBidAdapter_spec.js @@ -69,10 +69,10 @@ describe('sharethrough adapter spec', function () { ], }, }, - bidder: 'equativ', + bidder: 'sharethrough', params: { - networkId: 111, - publisherId: 73 + pkey: 111, + equativNetworkId: 73 }, requestId: 'efgh5678', ortb2Imp: { @@ -109,10 +109,10 @@ describe('sharethrough adapter spec', function () { placement: 1, }, }, - bidder: 'equativ', + bidder: 'sharethrough', params: { - networkId: 111, - publisherId: 73 + pkey: 111, + equativNetworkIdId: 73 }, requestId: 'abcd1234', ortb2Imp: { @@ -169,8 +169,8 @@ describe('sharethrough adapter spec', function () { }, nativeOrtbRequest, params: { - networkId: 777, - publisherId: 73 + pkey: 777, + equativNetworkId: 73 }, requestId: 'sharethrough_native_reqid_42', ortb2Imp: { @@ -380,10 +380,10 @@ describe('sharethrough adapter spec', function () { }, sizes: [], nativeOrtbRequest, - bidder: 'equativ', + bidder: 'sharethrough', params: { - networkId: 111, - publisherId: 73 + pkey: 111, + equativNetworkId: 73 }, requestId: 'efgh5678', ortb2Imp: { @@ -989,17 +989,17 @@ describe('sharethrough adapter spec', function () { }); describe('isEqtvTest', () => { - it('should set publisher id if publisherId param is present', () => { + it('should set publisher id if equativNetworkId param is present', () => { const builtRequest = spec.buildRequests(multiImpBidRequests, bidderRequest)[0] expect(builtRequest.data.site.publisher.id).to.equal(73) }) - it('should not set publisher id if publisherIdParam is not present', () => { + it('should not set publisher id if equativNetworkId param is not present', () => { const bidRequest = { ...bidRequests[0], params: { ...bidRequests[0].params, - publisherId: undefined + equativNetworkId: undefined } }