1- import { registerBidder } from '../src/adapters/bidderFactory.js' ;
2- import { getStorageManager } from '../src/storageManager.js' ;
3- import { BANNER } from '../src/mediaTypes.js' ;
4- import { config } from '../src/config.js' ;
5- import { deepAccess , isArray , isNumber , isPlainObject } from '../src/utils.js' ;
6- import { auctionManager } from '../src/auctionManager.js' ;
7- import { getANKeywordParam } from '../libraries/appnexusUtils/anKeywords.js' ;
8- import { convertCamelToUnderscore } from '../libraries/appnexusUtils/anUtils.js' ;
9- import { transformSizes } from '../libraries/sizeUtils/tranformSize.js' ;
10- import { addUserId , hasUserInfo , getBidFloor } from '../libraries/adrelevantisUtils/bidderUtils.js' ;
1+ import { registerBidder } from '../src/adapters/bidderFactory.js' ;
2+ import { getStorageManager } from '../src/storageManager.js' ;
3+ import { BANNER } from '../src/mediaTypes.js' ;
4+ import { config } from '../src/config.js' ;
5+ import { deepAccess , isArray , isNumber , isPlainObject } from '../src/utils.js' ;
6+ import { auctionManager } from '../src/auctionManager.js' ;
7+ import { getANKeywordParam } from '../libraries/appnexusUtils/anKeywords.js' ;
8+ import { convertCamelToUnderscore } from '../libraries/appnexusUtils/anUtils.js' ;
9+ import { transformSizes } from '../libraries/sizeUtils/tranformSize.js' ;
10+ import { addUserId , hasUserInfo , getBidFloor } from '../libraries/adrelevantisUtils/bidderUtils.js' ;
1111
1212const SOURCE = 'pbjs' ;
13- const storageManager = getStorageManager ( { bidderCode : 'pixfuture' } ) ;
13+ const storageManager = getStorageManager ( { bidderCode : 'pixfuture' } ) ;
1414const USER_PARAMS = [ 'age' , 'externalUid' , 'segments' , 'gender' , 'dnt' , 'language' ] ;
1515let pixID = '' ;
1616const GVLID = 839 ;
@@ -31,7 +31,7 @@ export const spec = {
3131
3232 isBidRequestValid ( bid ) {
3333 return ! ! ( bid . sizes && bid . bidId && bid . params &&
34- ( bid . params . pix_id && ( typeof bid . params . pix_id === 'string' ) ) ) ;
34+ ( bid . params . pix_id && ( typeof bid . params . pix_id === 'string' ) ) ) ;
3535 } ,
3636
3737 buildRequests ( validBidRequests , bidderRequest ) {
@@ -50,7 +50,7 @@ export const spec = {
5050 const userObjBid = ( ( validBidRequests ) || [ ] ) . find ( hasUserInfo ) ;
5151 let userObj = { } ;
5252 if ( config . getConfig ( 'coppa' ) === true ) {
53- userObj = { 'coppa' : true } ;
53+ userObj = { 'coppa' : true } ;
5454 }
5555
5656 if ( userObjBid ) {
@@ -62,7 +62,7 @@ export const spec = {
6262 const segs = [ ] ;
6363 userObjBid . params . user [ param ] . forEach ( val => {
6464 if ( isNumber ( val ) ) {
65- segs . push ( { 'id' : val } ) ;
65+ segs . push ( { 'id' : val } ) ;
6666 } else if ( isPlainObject ( val ) ) {
6767 segs . push ( val ) ;
6868 }
@@ -101,16 +101,17 @@ export const spec = {
101101 payload . referrer_detection = refererinfo ;
102102 }
103103
104- if ( validBidRequests [ 0 ] . userId ) {
104+ if ( validBidRequests [ 0 ] ?. ortb2 ?. user ?. ext ?. eids ?. length ) {
105105 const eids = [ ] ;
106+ const ortbEids = validBidRequests [ 0 ] . ortb2 . user . ext . eids ;
106107
107- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.criteoId` ) , 'criteo.com' , null ) ;
108- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.unifiedId` ) , 'thetradedesk.com' , null ) ;
109- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.id5Id` ) , 'id5.io' , null ) ;
110- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.sharedId` ) , 'thetradedesk.com' , null ) ;
111- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.identityLink` ) , 'liveramp.com' , null ) ;
112- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.liveIntentId` ) , 'liveintent.com' , null ) ;
113- addUserId ( eids , deepAccess ( validBidRequests [ 0 ] , `userId.fabrickId` ) , 'home.neustar' , null ) ;
108+ ortbEids . forEach ( eid => {
109+ const source = eid . source ;
110+ const uids = eid . uids || [ ] ;
111+ uids . forEach ( uidObj => {
112+ addUserId ( eids , uidObj . id , source , uidObj . atype || null ) ;
113+ } ) ;
114+ } ) ;
114115
115116 if ( eids . length ) {
116117 payload . eids = eids ;
@@ -124,7 +125,7 @@ export const spec = {
124125 const ret = {
125126 url : `${ hostname } /pixservices` ,
126127 method : 'POST' ,
127- options : { withCredentials : true } ,
128+ options : { withCredentials : true } ,
128129 data : {
129130 v : 'v' + '$prebid.version$' ,
130131 pageUrl : referer ,
@@ -245,7 +246,7 @@ function bidToTag(bid) {
245246 tag . reserve = bidFloor ;
246247 }
247248 if ( bid . params . position ) {
248- tag . position = { 'above' : 1 , 'below' : 2 } [ bid . params . position ] || 0 ;
249+ tag . position = { 'above' : 1 , 'below' : 2 } [ bid . params . position ] || 0 ;
249250 } else {
250251 const mediaTypePos = deepAccess ( bid , `mediaTypes.banner.pos` ) || deepAccess ( bid , `mediaTypes.video.pos` ) ;
251252 // only support unknown, atf, and btf values for position at this time
@@ -283,7 +284,7 @@ function bidToTag(bid) {
283284 }
284285
285286 if ( bid . renderer ) {
286- tag . video = Object . assign ( { } , tag . video , { custom_renderer_present : true } ) ;
287+ tag . video = Object . assign ( { } , tag . video , { custom_renderer_present : true } ) ;
287288 }
288289
289290 if ( bid . params . frameworks && isArray ( bid . params . frameworks ) ) {
0 commit comments