HTL client v3 API includes methods and properties organized into groups, and is publicly available on the HTL global instance, named htlbid by default. It is assumed in the examples of this page that the HTL global instance is named htlbid , but publishers may rename it as they wish.

Basic Methods

These methods are always available:

Default Methods

These methods, mainly for managing HTL slots, are available when any API groups of divs , layout , and imperative are selected:

Optional API Groups

config

Static configurations for HTL client. as defined on HTL UI, are exposed on the global HTL instance. config is the entry object for the exposed configurations. Currently only Prebid.js configurations are available at config.prebid , e.g. const prebidGroups = htlbid.config.prebid.groups. We may add or change more in future.

divs

This includes one method display , e.g. htlbid.display(). It searches DOM for eligible ad DIVs for HTL client to show ads. This also supports data attributes on the DIVs like data-unit for GAM, data-gpid for Prebid.js, data-eager for lazy loading, so on and so forth, when their respective modules are enabled. Note htlbid.display only searches DOM by one pass when it is called, and does not monitor changes in DOM afterwards, nor it does any more searches automatically.

layout

htlbid.layout works the same way as htlbid.display, but monitors DOM and searches for ad DIVs over and over again automatically, e.g. htlbid.layout() . It also accepts argument false to stop monitoring DOM, e.g. htlbid.layout(false) . For being backward compatible with v2, any values other than false are deemed as starting monitoring DOM. Starting (or stopping) monitoring again when it has been started (or stopped) has no effect.

gpt-patched