The Prebid Universal Creative (PUC) is a collection of rendering routines that can pull a particular ad ID from Prebid’s cache and do the right thing to display it. The scripts are generally entered into the ad server for when a Prebid ad has won the auction. There are a number of use cases:
Use Case | PUC file | Alternate Approach |
---|---|---|
web banner: iframe | creative.js | Banner and Outstream Video iframes |
web banner: safeframe | creative.js | Banner Safeframes |
web outstream video: iframe | creative.js | Banner and Outstream Video iframes |
web outstream video: safeframe | n/a | Outstream renderers each choose where to render differently, but none writes to the safeframe. |
AMP banner: always safeframe | creative.js | n/a |
native: iframe | native-render.js | n/a |
native: safeframe | native-render.js | n/a |
The Prebid Universal Creative is the simplest approach for publishers to configure Prebid in their ad server. The PUC provides a creative configuration that can be used across several formats, platforms, devices, and ad servers.
Here are the features of the PUC in various scenarios:
${AUCTION_PRICE}
macro in the creative body.Some publishers prefer to not load the extra creative.js code at render time due to a tiny but measurable impact on measurement discrepancies.
While Prebid recommends the use of creative.js because we regularly add features and fix bugs, publishers may choose to hardcode the functionality into their ad server creatives.
They would do this differently for each of the scenarios below.
If you only ever need to display non-safeframed banner and outstream-video creatives, you may use
the simple approach of just calling the Prebid.js renderAd
function directly:
<script> var w = window; for (i = 0; i < 10; i++) { w = w.parent; if (w.pbjs) { try { w.pbjs.renderAd(document, '%%PATTERN:hb_adid%%'); break; } catch (e) { continue; } } } </script>
See the example at https://github.com/prebid/Prebid.js/blob/master/integrationExamples/gpt/x-domain/creative.html
This is basically just part of the PUC that’s been isolated to be standalone.