Set custom parameters to bids, and get them back in responses

188 views Asked by At

I need to trace bid responses to an entity in my application. Is there any way to achieve this?

Eg. for each bid request set some bids[0].custom, and then have it in response.custom.

Right now my approach is to make each bid request in a dedicated adunit, since every bid response contains adunit property. I am wondering if there is any cleaner and more native way.

1

There are 1 answers

1
ngIf_happy On

The way you suggest is actually the recommended way by the Prebid team as well. In their API docs they offer a way to access bid responses by adunit name, pbjs.getBidResponsesForAdUnitCode. However, if you wanted to modify Prebid source code to achieve some sort of unique id targeting between your bid request an responses beside the ad unit name and ad unit code you could access the adaptermanager.js file in src folder and within the makeBidRequests hook, add a property to the bidderRequest object in the clientBidderCodes.forEach loop. You would also then need to handle that property in the bidResponse equivalent.