Skip to content

Commit

Permalink
Sparteo Bid Adapter: Add Prebid.JS Version (#12419)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanguylemeur-sparteo authored Nov 6, 2024
1 parent ee61757 commit 655712c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions modules/sparteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ const converter = ortbConverter({
request(buildRequest, imps, bidderRequest, context) {
const request = buildRequest(imps, bidderRequest, context);

deepSetValue(request, 'site.publisher.ext.params.pbjsVersion', '$prebid.version$');

if (bidderRequest.bids[0].params.networkId) {
deepSetValue(request, 'site.publisher.ext.params.networkId', bidderRequest.bids[0].params.networkId);
request.site.publisher.ext.params.networkId = bidderRequest.bids[0].params.networkId;
}

if (bidderRequest.bids[0].params.publisherId) {
deepSetValue(request, 'site.publisher.ext.params.publisherId', bidderRequest.bids[0].params.publisherId);
request.site.publisher.ext.params.publisherId = bidderRequest.bids[0].params.publisherId;
}

return request;
Expand Down
9 changes: 6 additions & 3 deletions test/spec/modules/sparteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ const VALID_REQUEST_BANNER = {
'publisher': {
'ext': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'pbjsVersion': '$prebid.version$'
}
}
}
Expand Down Expand Up @@ -123,7 +124,8 @@ const VALID_REQUEST_VIDEO = {
'publisher': {
'ext': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'pbjsVersion': '$prebid.version$'
}
}
}
Expand Down Expand Up @@ -183,7 +185,8 @@ const VALID_REQUEST = {
'publisher': {
'ext': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'pbjsVersion': '$prebid.version$'
}
}
}
Expand Down

0 comments on commit 655712c

Please sign in to comment.