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

callback event on BidWon

Open Reduxmedia opened this issue 10 years ago • 7 comments

Hi,

I am trying to add a callback event on "BidWon", but seems like addCallback function doesn't care about BidWon. How should I capture it?

Thanks.

Reduxmedia avatar Dec 24 '15 16:12 Reduxmedia

Hi @Reduxmedia

Are you trying to listen to an event externally from prebid.js? Currently events are only supported internally in the framework. Can you provide some sample code that you are using so we can understand your use case? Thanks

mkendall07 avatar Jan 04 '16 16:01 mkendall07

Happy new year @Reduxmedia!

If by "BidWon" you mean a bid from one of the prebid partners is selected by the adserver, then we don't have an event for that yet. We'll put this in our todo queue and prioritize it accordingly.

If you need it urgently, it can also be pretty easily accomplished by adding a listener to the "pbjs.renderAd" function (if you're using it): http://prebid.org/dev-docs/publisher-api-reference.html#module_pbjs.renderAd

This function will only get triggered when a prebid creative has been chosen by the adserver to serve back to the page. This will be the equivalent to "BidWon". Let us know if this doesn't make sense. Thanks!

ghost avatar Jan 04 '16 22:01 ghost

Thanks!

Reduxmedia avatar Jan 05 '16 13:01 Reduxmedia

@prebid & @Reduxmedia

We already have an event for bidWon, like I mentioned it is only accessible internally. If you want an external handler for it then we'll need to add that as a feature.

https://github.com/prebid/Prebid.js/blob/master/src/prebid.js#L525

mkendall07 avatar Jan 05 '16 15:01 mkendall07

Closing this, please reopen if any further info.

protonate avatar Feb 10 '16 18:02 protonate

Reopening and there will be a PR for this in the next day or two.

protonate avatar Feb 17 '16 17:02 protonate

PR #204 has been merged. A bidWon event can be registered using the .onEvent() API, as documented in the PR conversation. Closing.

protonate avatar Feb 26 '16 22:02 protonate