可能發生的主控台錯誤

所有列印在控制台中的訊息前置字串都會是 [Ad Placement API]

您只能設定 preloadAdBreaks 一次:

  • 系統已呼叫 adConfig(),以設定值為 <VALUE>preloadAdBreaks

嘗試在呼叫 adBreak() 的同時又呼叫 adBreak() (請確保您未從其他工作站觸發廣告,且您未在回呼函式中呼叫 adBreak()):

  • Cannot show ad while another ad is already visible.

執行您提供的任何回呼時失敗:

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

標記參數發生錯誤:

  • 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() 引數驗證錯誤:

  • Invalid ad config: <ERROR>. 其中 <ERROR> 可以是:
    • preloadAdBreaks must be one of ['auto', 'on']
    • sound must be one of ['on', 'off']
    • onReady」必須是函式

adBreak() 引數驗證錯誤:

  • Invalid placement config: <ERROR><ERROR> 可以是:
    • 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>

adBreak() 中的重新命名回呼 (beforeBreakafterBreakadComplete) 已分別重新命名為 beforeAdafterAdadViewed。但功能仍完全相同:

  • 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.