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

defaultBidderSettings question

Open derdeka opened this issue 10 years ago • 6 comments

Hi,

we've looked for a way how a custom adapter (not shipped with prebid dist) can self register its defaultBidderSettings. The bidmanager @ Line220 offers a great way to register default bidder settings (registerDefaultBidderSetting), but the problem is that i do not know the current bidderCode within the adapter implementation.

In a previous version (https://github.com/prebid/Prebid.js/pull/349/files#diff-48ea3f8ed102d50a45c9bdf68efd3021L33 @ Line33) there was a way to define defaultBidderSettings which were propagated on adapter registration.

What is the best way to self register defaultBidderSettings from a adapter itself?

derdeka avatar Oct 17 '16 18:10 derdeka

@derdeka Why doesn't the adapter know it's bidderCode? That would be the way to do it...

mkendall07 avatar Oct 17 '16 19:10 mkendall07

Our publishers register our prebid adapter programmatically with pbjs.registerBidAdapter(bidderImpl, bidderCode) which registers the adapter in adaptermanager with the given name (which we are not aware of).

How do we get the bidderCode within the adapter implementation to set our defaultBidderSettings? Before Refactoring in [PR349](https://github.com/prebid/Prebid.js/pull/349/files#diff-48ea3f8ed102d50a45c9bdf68efd3021L33 @ Line33) it was not neccessary to know the adapters bidderCode because the defaultBidderSettings were propagated automatically on bidder registration.

@mkendall07 Do you suggest to iterate through the adaptermanager's bidderRegistry to find our own adapter? Or is there a alternative/direct way to get the bidder's name(s)?

derdeka avatar Oct 17 '16 20:10 derdeka

@derdeka I see what you mean. I don't think there is a method to do that now. I'll mark this as a feature to add the bidder identifier to the adapter registered externally.

mkendall07 avatar Oct 24 '16 18:10 mkendall07

@jaiminpanchal27 Does registering a bidder adapter at runtime work in prebid 1.0?

mkendall07 avatar Nov 10 '17 13:11 mkendall07

No, $$PREBID_GLOBAL$$.registerBidAdapter needs small update to support that. It seems one line change.

jaiminpanchal27 avatar Nov 10 '17 15:11 jaiminpanchal27

Closing this as the way going forward would be to include your adapter the prebid repo. 1.0 will not support runtime additions of adapters.

mkendall07 avatar Nov 29 '17 21:11 mkendall07