Prebid.js dynamic creatives

Overview

For line items that target browsers only, you may use Prebid.js dynamic creatives as an alternative to Prebid Universal Creative. The former provides slightly better performance and ease of use, but relies on Prebid.js, meaning that it does not support non-JS use cases (such as mobile apps or AMP).

Comparison vs PUC for Prebid.js

A creative set up to use Prebid Universal Creative:

  • loads a separate script, typically from a CDN; the script contains various rendering routines, including some specific to Prebid.js;
  • if the script determines that the ad render was initiated by Prebid.js, it retrieves from it information about the winning bid and renders it;
  • requires different setups for different use cases (such as banner vs native).

A Prebid.js dynamic creative:

  • does not load any additional script - it’s instead set up with a small block of inline Javascript;
  • it expects to always find Prebid.js, retrieving from it information about the winning bid and the rendering logic to use for it;
  • uses the same setup for all cases - but does not work when the render is not initiated by Prebid.js.

How to use

Dynamic creatives require Prebid.js version 8.36 or higher.

Set up the creative following this example. If you are not using GAM, replace the macros in the second script tag with appropriate equivalents.

To render native ads, you also need to include the nativeRendering module in your Prebid.js bundle.

Further reading