Skip to content

Commit

Permalink
SparteoBidAdapter: Send bidder params in OpenRTB request (prebid#10760)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffray-viously authored Nov 28, 2023
1 parent 6a0c7f0 commit 4e323bf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
7 changes: 7 additions & 0 deletions modules/sparteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ const converter = ortbConverter({

return request;
},
imp(buildImp, bidRequest, context) {
const imp = buildImp(bidRequest, context);

deepSetValue(imp, 'ext.sparteo.params', bidRequest.params);

return imp;
},
bidResponse(buildBidResponse, bid, context) {
context.mediaType = deepAccess(bid, 'ext.prebid.type');

Expand Down
33 changes: 30 additions & 3 deletions test/spec/modules/sparteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const VALID_BID_BANNER = {
bidId: '1a2b3c4d',
adUnitCode: 'id-1234',
params: {
networkId: '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
networkId: '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
formats: ['corner']
},
mediaTypes: {
banner: {
Expand Down Expand Up @@ -64,6 +65,14 @@ const VALID_REQUEST_BANNER = {
'w': 1
}],
'topframe': 0
},
'ext': {
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'formats': ['corner']
}
}
}
}],
'site': {
Expand Down Expand Up @@ -99,7 +108,12 @@ const VALID_REQUEST_VIDEO = {
'maxduration': 30,
},
'ext': {
'pbadslot': 'video'
'pbadslot': 'video',
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
}
}
}
}],
'site': {
Expand Down Expand Up @@ -127,6 +141,14 @@ const VALID_REQUEST = {
'w': 1
}],
'topframe': 0
},
'ext': {
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'formats': ['corner']
}
}
}
}, {
'id': '5e6f7g8h',
Expand All @@ -144,7 +166,12 @@ const VALID_REQUEST = {
'maxduration': 30,
},
'ext': {
'pbadslot': 'video'
'pbadslot': 'video',
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
}
}
}
}],
'site': {
Expand Down

0 comments on commit 4e323bf

Please sign in to comment.