Set the layout and frequency of ads automatically inserted in an article, and manually suggest specific locations for ad content.
- Apple News Format
- Apple News API
Ads can be placed at any of the following locations:
Between two paragraphs inside a
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
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
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.