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.
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 theadaptermanager.js
file in src folder and within themakeBidRequests
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.