Possible console errors

All messages printed to the console will have the prefix [Ad Placement API]:

You can only set preloadAdBreaks once:

  • adConfig() was already called to set preloadAdBreaks with value <VALUE>

Tried to call adBreak() while another call to adBreak() was still in process (ensure that you are not triggering ads from other workers, and that you are not calling adBreak() from within a callback function):

  • Cannot show ad while another ad is already visible.

Failures when executing any callback you have provided:

  • <CALLBACK NAME> callback threw an error: <ERROR>

Errors in tagging parameters:

  • Invalid data-ad-frequency-hint value: '<VALUE>'. It must be in format 'Xs' where X is a number.
  • Unsupported data-adbreak-test value '<VALUE>'. Supported values: 'on'.

adConfig() argument validation errors:

  • Invalid ad config: <ERROR>. Where <ERROR> can be:
    • preloadAdBreaks must be one of ['auto', 'on']
    • sound must be one of ['on', 'off']
    • onReady must be a function

adBreak() argument validation errors:

  • Invalid placement config: <ERROR>. Where <ERROR> can be:
    • missing required properties <LIST OF PROPERTIES>
    • <CALLBACK NAME> must be a function
    • <PROPERTY NAME> must be one of <LIST OF VALID VALUES>
    • the following properties are not used for the given ad type: <LIST OF PROPERTIES>

Renamed callbacks in adBreak() (beforeBreak, afterBreak, and adComplete have been renamed to beforeAd, afterAd and adViewed respectively. They still function in exactly the same way):

  • Placement config: <OLD> has been renamed to <NEW>. Please update your code.
  • Invalid placement config: <OLD> has been renamed to <NEW>. Cannot pass both fields. Please use <NEW> only.