Skip to main content

adRefresh

Refreshes the specified ad unit by finding its slot and triggering a refresh. Always pass an object with either adunit (ad unit code) or divId (DOM element id). If both are provided, divId takes precedence.

Signature

adRefresh({ adunit, divId })

Category

Runtime

Parameters

NameTypeRequiredDefaultDescription
optionsObjectYesnullOptions object containing either adunit (string ad unit code) or divId (string DOM id). If both provided, divId will be used.

Returns

boolean

Resolves when the refresh has been initiated.

Usage

  • Use throttling/debouncing if calling frequently to avoid excessive network requests.
  • Prefer targeting specific slots rather than refreshing all.

Examples

Refresh by adunit (code)

bqjs.adRefresh({ adunit: "banner_1" });

Refresh by divId

bqjs.adRefresh({ divId: "banner_div_1" });

Refresh with both (divId takes precedence)

bqjs.adRefresh({ adunit: "banner_1", divId: "banner_div_1" });