Enabling in page ad units
To monetize Turbo pages, you can include Yandex Advertising Network ad blocks or ads from other systems using Adfox.
To enable these ads, perform the following steps:
Step 1. Create an ad unit
- In the Yandex Advertising Network interface, create a Banner type block. In the block settings, in the Block for Turbo / AMP field, be sure to select Turbo.
- Get the embed code: in the block settings, click Get Code.
- Copy the block ID from the code.
In Adfox, create a placement for Turbo pages.
To add ads to Turbo pages, you need an ad tag.
- Go to.
- Copy the code starting with the div element.
<div id="adfox_123456789123456789"></div>
<script>
window.yaContextCb.push(()=>{
window.Ya.adfoxCode.create({
ownerId: 123456,
containerId: 'adfox_123456789123456789',
params: {
pp: 'g',
ps: 'ezwy',
p2: 'gnhv'
}
})
})
</script>
Step 2. Enable and verify it
An ad unit can be placed on the page manually or automatically.
- In Yandex Webmaster, go to.
- In the Ad blocks in your content section, click Add and select the ad block type.
- Depending on the unit type, enter the unit ID in the Yandex Advertising Network field or the ad tag in the Adfox field.
- If you enter several ad units, put them in display priority order using the icon. The order will be taken into account when placing ads.
- Save your changes.
- Specify the information on thepage.
- Delete the turbo:adNetwork element and its contents from the RSS feed.
- Wait for the RSS file to be updated in Yandex Webmaster.
- In Yandex Webmaster, go to.
- In the Add and select the ad unit type.section, click
- Depending on the unit type, enter the unit ID in the Yandex Advertising Network field or the ad tag in the Adfox field.
- In the turbo-ad-id field, enter an arbitrary ID, such as first_ad_place.
- Save your changes.
In the RSS feed, specify the placement position of the ad using the figure element. Add a data-turbo-ad-id attribute for it with the ID that you entered at the previous step.
<figure data-turbo-ad-id="first_ad_place"></figure>
Copied to clipboard- Go back toand check the ad display on a sample Turbo page.
If you enabled ads in the Yandex Webmaster interface, don't add ads to the RSS feed.
Pass the ad information in the turbo:adNetwork element:
Supported ad blocks:... <channel> ... <turbo:adNetwork></turbo:adNetwork> ... </channel> ...
Copied to clipboardExample of how to enable:<turbo:adNetwork type="Yandex" id="R-A-123456-7" turbo-ad-id="first_ad_place"> </turbo:adNetwork>
Copied to clipboardtype
*Type of add. Takes the value Yandex.id
*ID of the Yandex Advertising Network ad unit (for example, R-A-123456-7).turbo-ad-id
*ID indicating the placement position of the ad.* Required
Attention. The Adfox ad tag must be specified inside the turbo:adNetwork element. Wrap it in a <![CDATA[]]>.<turbo:adNetwork type="Adfox" turbo-ad-id="first_ad_place"> <![CDATA[ <div id="container ID 1"></div> <script> window.Ya.adfoxCode.create({ ownerId: 123456, containerId: 'container ID 1', params: { pp: 'g', ps: 'cmic', p2: 'fqem' } }); </script> ]]> </turbo:adNetwork>
Copied to clipboardtype
*Type of add. Takes the value Adfox.turbo-ad-id
*ID indicating the placement position of the ad.* Required
- In the page content, specify the ad placement position using the figure element. Add a data-turbo-ad-id attribute with the ID that you specified in the turbo-ad-id attribute of the turbo:adNetwork element.
Example:
<figure data-turbo-ad-id="first_ad_place"></figure>
Copied to clipboardNote.If the turbo-ad-id attribute or its value is missing, only the first ad unit at the bottom of the Turbo page is displayed.
If the turbo-ad-id attribute is specified only for a few ad units, the ads aren't displayed.