relevantDigital.addPrebidConfig()

relevantDigital.addPrebidConfig() MUST be used instead of manually using pbjs.setConfig() in Prebid.JS.

The pbjs.setConfig() function for configuring Prebid will be called once by our library immediately before triggering the first Prebid auction. The addPrebidConfig() function merges the provided settings into the configuration object that will be supplied in that call. Please follow the following rules:

  • Don't call pbjs.setConfig() directly as that might cause unexpected behavior.
  • Make sure to call addPrebidConfig() before the first call to relevantDigital.loadPrebid() (or more specifically - before the first such call that involves placements that are using Prebid). If done at a later stage the call will have no effect. However it won't cause any harm to call it at a later stage either

Example

window.relevantDigital = window.relevantDigital || {};
relevantDigital.cmd = relevantDigital.cmd || [];
relevantDigital.cmd.push(function() {
relevantDigital.addPrebidConfig({ // merge some prebid config
  ortb2: {
     site: {
         keywords: "relevant, yield",
     },
  },  
});
relevantDigital.loadPrebid({ ... }); // load some ads
})