Contents

AdvertisementAutoPlacement

The object for defining the automatic placement of advertisements.

Declaration

object AdvertisementAutoPlacement

Properties

NameTypeDescription
bannerTypestring

A specific banner type that should be automatically inserted based on the frequency value. If advertisement placement is enabled, only banners of the defined size type are inserted.

conditional(ConditionalAutoPlacement | [ConditionalAutoPlacement])

An instance or array of automatic placement properties that can be applied conditionally, and the conditions that cause them to take effect.

distanceFromMedia(SupportedUnits | number)

The minimum required distance between automatically inserted advertisement components and media, such as Video and Photo. Advertisements will show next to media if distanceFromMedia is not specified. To maintain a minimum distance of half a screen height from your media content, use a value of around 10vh. For more information, see Specifying Measurements for Components.

enabledboolean

A Boolean that defines whether placement of advertisements is enabled.

frequencyinteger

A number from 0 to 10, defining the frequency for automatically inserting ads into articles.

Setting this value to 1 automatically inserts a dynamic advertisement in the first possible location below the screen bounds.

Setting this value to 2 inserts a dynamic advertisement in the first possible location below the screen bounds, and another between the first dynamic advertisement and the end of the article.

Increasing the frequency value increases the frequency of dynamic advertisements below the first screen bounds.

Setting this value to 0, or omitting it, results in no advertisements.

layoutAutoPlacementLayout

The layout properties for automatically inserted components.

Mentioned in

Discussion

Use the AdvertisementAutoPlacement object to insert dynamic advertisements between Body, Chapter, Section, or Container components in an article.

Example

{
  "version": "1.9",
  "identifier": "SampleArticle",
  "language": "en",
  "title": "Apple News",
  "layout": {
    "columns": 20,
    "width": 1024,
    "margin": 60,
    "gutter": 20
  },
  "autoplacement": {
    "advertisement": {
      "enabled": true,
      "bannerType": "any",
      "distanceFromMedia": "10vh",
      "frequency": 10,
      "layout": {
        "margin": 10
      }
    }
  },

}

See Also

Dynamic Advertising