Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

getAdserverTargeting() for Vast Url parameter ?

Open Deimos01 opened this issue 9 years ago • 2 comments

Hello,

I'm looking for a function like "getAdserverTargeting()" but to retrieve the Vast url of my winning bid. I'm not using DFP and I have 3 outstream bidders so I would like to manipulate the Vasturl parameter of my winning bid (to send it to my adserver). I didn't find this kind of function in the documentation.

I can only have access to this parameter by doing something like this : bidResponses.video.bids[0].vastUrl But it's not really the winning bid if you have more than one oustream bidder.

Thanks,

Deimos01 avatar Jul 20 '17 18:07 Deimos01

Would pbjs.getHighestCpmBids fit your use case? It'll return an array of winning bids for each ad unit, or an array with the winning bid for a single ad unit that's passed to that function as a parameter.

Then to get the vast url, something like

const bid = pbjs.getHighestCpmBids()[0];
const vastUrl = bid && bid.vastUrl;
// ...

matthewlane avatar Jul 20 '17 23:07 matthewlane

Thank you very much @matthewlane . This function is perfect :).

Have a wonderful day.

Deimos01 avatar Jul 21 '17 14:07 Deimos01