Skip to content

Commit

Permalink
Add customParams to yieldlab configuration (#5374)
Browse files Browse the repository at this point in the history
Customers are using custom parameters to our endpoint to use them downstream. We need a way of supporting this in prebid.
  • Loading branch information
mirkorean committed Jun 22, 2020
1 parent ba6d904 commit cc845b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/yieldlabBidAdapter.js
Expand Up @@ -42,6 +42,11 @@ export const spec = {
if (bid.userIdAsEids && Array.isArray(bid.userIdAsEids)) {
query.ids = createUserIdString(bid.userIdAsEids)
}
if (bid.params.customParams && utils.isPlainObject(bid.params.customParams)) {
for (let prop in bid.params.customParams) {
query[prop] = bid.params.customParams[prop]
}
}
})

if (bidderRequest && bidderRequest.gdprConsent) {
Expand Down
8 changes: 8 additions & 0 deletions test/spec/modules/yieldlabBidAdapter_spec.js
Expand Up @@ -12,6 +12,10 @@ const REQUEST = {
'key1': 'value1',
'key2': 'value2'
},
'customParams': {
'extraParam': true,
'foo': 'bar'
},
'extId': 'abc'
},
'bidderRequestId': '143346cf0f1731',
Expand Down Expand Up @@ -88,6 +92,10 @@ describe('yieldlabBidAdapter', function () {
expect(request.url).to.include('ids=netid.de%3AfH5A3n2O8_CZZyPoJVD-eabc6ECb7jhxCicsds7qSg')
})

it('passes extra params to bid request', function () {
expect(request.url).to.include('extraParam=true&foo=bar')
})

const gdprRequest = spec.buildRequests(bidRequests, {
gdprConsent: {
consentString: 'BN5lERiOMYEdiAKAWXEND1AAAAE6DABACMA',
Expand Down

0 comments on commit cc845b0

Please sign in to comment.