Ad units for AMP pages
You can monetize AMPs (Accelerated Mobile Pages) using Yandex Advertising Network ad units.
Yandex Advertising Network units placed on AMP pages can display:
To place a Yandex Advertising Network unit:
-
In the Yandex Advertising Network interface, create a Banner unit. In the unit settings, be sure to select AMP in the AMP field.
-
Get the ad tag: in the unit settings, click Get code.
-
Make changes to the site page's code:
In-page unit
-
Add a script with the amp-ad component to the
<head>. -
Copy the ad tag to the clipboard and paste it on the site page where you want to display the unit.
-
Change the
heightparameter value to the height you set for the unit. In the ad tag, the default height is 320 pixels.
Floor Ad unit
-
Add a script with the amp-sticky-ad component to the
<head>. -
Wrap the ad unit code with the following tags:
<amp-sticky-ad layout="nodisplay"> // ad unit code </amp-sticky-ad> -
Configure the ad unit parameters:
-
width: Width in pixels. -
height: Height in pixels (maximum value: 100). -
Delete the
layout="fixed-height"parameter.
-
-
Paste the code into the site page section where you want to display the unit.
Sample ad tag for a Floor Ad unit
<amp-sticky-ad layout="nodisplay"> <amp-ad width="350" height="100" type="yandex" data-block-id="R-A-123456-1" data-html-access-allowed="true"> </amp-ad> </amp-sticky-ad>
Another type of unit
You can place banners into various types of units in accordance with the AMP documentation requirements.
-
Note
The unit code for AMP pages is different from the unit code for other site versions. If you place this unit on a regular site, there won't be any ad impressions.