Skip to content

Javascript API Reference

Matthew Boynes edited this page Jan 18, 2016 · 1 revision

AdLayersAPI

  • refresh(string adUnit): Refresh a single ad unit.
  • refreshAll(): Refresh all ad units.
  • lazyLoadAd(object args): Lazy-load an ad. See individual ad servers for object properties.
  • debug(): Enable debug mode.

AdLayersDFPAPI

  • lazyLoadAd(object args)
    • String slotName Required. The unique name for this ad slot. This is appended to adLayersDFP.adUnitPrefix to form the ad div's ID.

    • String format Optional. The ad unit to model in building this ad slot. This is what you configured in the WordPress Admin (and most likely, chose to not render on load).

      If this is provided, path, sizes, targeting, and sizeMapping can all be derived from the ad slot data. However, if any of those is provided, it overrides the information pulled from the ad slot data. If this is absent, you must provide path and sizes, at a minimum.

    • String path Optional. The ad slot path, e.g. /6355419/Travel/Europe/France/Paris.

    • Array sizes Optional. The ad slot size(s), e.g. [300,250] or [[300,250],[300x600]].

    • Object targeting Optional. key: value targeting pairs passed to setTargeting(), e.g. {"test": ["infinitescroll"]}

    • Array sizeMapping Optional. Size mapping to pass to defineSizeMapping().

Clone this wiki locally