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

Support for dynamic renderer in PBS adapter

Open ccorbo opened this issue 2 years ago • 3 comments

Type of issue

Feature Request

Description

I am opening this issue to initiate a discussion regarding the implementation of support for a dynamic renderer within the Prebid Server bid adapter.

This proposed feature aims to enable the inclusion of a renderer URL within the bid response. With the presence of this field, the necessity for defining the renderer at the ad unit level would be eliminated. Consequently, the validation criteria for a valid bid would need to be adjusted to accommodate this new field.

To implement this, the process of setting the renderer on the bid requires updates. During a local POC I updated the getPreparedBidForAuction function in auction.js, this was updated to set the bid.renderer function, using the new renderer url that was passed in via the bid response.

It's important to note that supporting a dynamic renderer and incorporating bid renderer installation into the core of Prebid.js would necessitate a standardized API for each renderer. Currently, different adapters have varying methods for rendering an outstream video player.

An example of standardization for custom renderers for native ad units is in the linked documentation. The same API could be required in supporting this feature, that is required in the native ad unit case.

https://docs.prebid.org/prebid/native-implementation.html#43-implementing-the-custom-renderer-scenario

I am seeking feedback on this requested feature.

I am also attaching a draft PR that shows an example implementation of the above described feature: https://github.com/prebid/Prebid.js/pull/10433

ccorbo avatar Sep 05 '23 20:09 ccorbo

@ccorbo could you align your pr with the new location specified in https://github.com/prebid/prebid-server/issues/3085

patmmccann avatar Sep 11 '23 15:09 patmmccann

@ccorbo could you align your pr with the new location specified in prebid/prebid-server#3085

Yes will update the linked PR with the new spec.

ccorbo avatar Sep 11 '23 16:09 ccorbo

#10433 includes a proposal on how to handle, see that issue for more details, or read below:

@dgirardi and I had a discussion over slack. Here's the proposal:

The interface for the javascript file would be:

render({width, height, adUrl, config}, win)

It would be placed in the page something like this:

<iframe>
  <script type="javascript" src="##RENDERER_URL##"></script>
  <script>
  render({width, height, adUrl, config}, window);
  </script>
</iframe>

But these details may vary and shouldn't matter to the author of the renderer.

Config is renderer-specific and may cover things like display details. e.g. the Rubicon renderer would support options the publisher could set like this:

pbjs.setConfig({
  rendererConfig:{
    rubicon: {
      closeButton: "style1",
      label: "label",
      collapse: false
    },
    ix: {
       ... any ix-specific parameters ...
    }
  }
});

To conform to this interface, the renderer javascript code would need to supply a render function that:

  • reads the width, height, adUrl, and config params
  • if relevant, parses the config params looking for its own values. Ignore others.
  • render

Perhaps someone familiar with renderer display details could standardize the config interface so multiple vendors could utilize the same pub-supplied config? i.e. perhaps defining a CSS style for a closeButton is something everyone does? Perhaps collapsibility is a common parameter?

Originally posted by @bretg in https://github.com/prebid/Prebid.js/issues/10433#issuecomment-2362209337

patmmccann avatar Feb 12 '25 17:02 patmmccann