Article

Managing Advertisements in Your Article

Set the layout and frequency of ads automatically inserted in an article, and manually suggest specific locations for ad content.

Overview

Ads can be placed at any of the following locations:

  • Between two body components

  • Between two paragraphs inside a body component

  • Between containers

  • After the last component—even if the article is shorter than one screen

Ads cannot be placed at these locations:

  • Immediately before or after an image

  • Between anchored components

  • In the first screen of an article

In addition to the location requirements, Apple News Format makes decisions about ad placement that you should understand before you decide to put ads into your articles:

  • Ad placement is affected by the size of your article and the arrangement of the components within it.

  • An ad can appear inside a component only if the container is full width.

  • Two ads cannot be displayed in the same viewport (the part of the document that is visible to the user).

Adjust Your Settings

One way to control the placement of ads in your article is to use the properties in the AdvertisementAutoPlacement object:

  • To automatically insert ads, set bannerType to any. (Medium rectangle ads can only be shown on iPad using the MediumRectangleAdvertisement component.)

  • To prevent ads from appearing too close to images or other media components, use the distanceFromMedia property.

Adjust Your Layout

Another way to control ad placement is by using the margin property of the AutoPlacementLayout object to specify top and bottom margins for ads.

See Also

Dynamic Advertising

object AutoPlacement

The object for automatically placing components within Apple News Format articles.

object AdvertisementAutoPlacement

The object for defining the automatic placement of advertisements.

object AdvertisingSettings

The object for defining properties that affect the frequency and placement with which banner advertisements and medium rectangle advertisements are automatically placed in your article.

Deprecated