Adding an in-content ad block
To monetize Turbo pages, you can include Yandex Advertising Network ad blocks or ads from other systems using Adfox.
Follow these steps to enable ads:
Step 1. Create an ad block
- Open the Yandex Advertising Network interface.
- Go to Add an RTB block.and click
- On the second step of creating the RTB block, select Desktop Turbo pages and click Next.
Customize Yandex.Direct ad formats and media advertising.
Limits: up to 728 pixels wide, up to 250 pixels high.
- Copy the ID of the created block and use it when connecting ads. ID has the R-A-123456-7 format.
In Adfox, create a platform for Turbo pages.
To add ads to Turbo pages, you need an embed code.
- Go to thetab.
- Copy the code starting with the div element.
<div id="container ID"/>
<script>
window.Ya.adfoxCode.create({
ownerId: 123456,
containerId: 'container ID',
params: {
pp: 'g',
ps: 'cmic',
p2: 'fqem'
}
});
</script>
Step 2. Activate and check
The Adfox formats aren't validated. Debug the ad display yourself before enabling desktop Turbo pages.
You can place ad blocks on the page manually or automatically.
- Go to the Ads on desktop section.page in Yandex.Webmaster and scroll to the
- In the Ad block in your content section, click the Add button and choose the ad block type.
- Depending on the block type, enter the block ID in the YAN field or the embed code in the Adfox field.
- If you add several ad blocks, put them in the display priority order using the icon. The order will be taken into account when placing ads.
- Save your changes.
- Enter information on.
- Delete the turbo:adNetwork element and its contents from the RSS feed.
- Wait until the RSS file is updated in Yandex.Webmaster.
- Go to the Ads on desktop section.page in Yandex.Webmaster and scroll to the
- In the Manual setting section, click Add and choose the ad block type.
- Depending on the block type, enter the block ID in the YAN field or the embed code in the Adfox field.
- In the turbo-ad-id field, set an ID, for example, first_ad_place.
- Save your changes.
In the RSS feed, specify the ad location in the figure element. Add the data-turbo-ad-id attribute with the ID value specified in the previous step and the
data-platform-desktop="true"
attribute:<figure data-turbo-ad-id="first_ad_place" data-platform-desktop="true"></figure>
Copied to clipboard- Go back to thepage and check how the ad is displayed on the sample Turbo page.
If you connected ads in Yandex.Webmaster, don't add them to the RSS feed.
Send the ad information in the turbo:adNetwork element:
Supported ad blocks:... <channel> ... <turbo:adNetwork></turbo:adNetwork> ... </channel> ...
Copied to clipboardConnection example:Attention. Specify the Adfox embed code in the turbo:adNetwork element. Wrap it in the <![CDATA[]] > tag.<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 clipboard* Required
- In the page content, specify the ad location in the figure element. Add the
data-platform-desktop="true"
attribute and the data-turbo-ad-id attribute with the ID value specified in the turbo-ad-id attribute of the turbo:adNetwork element.Example:
<figure data-turbo-ad-id="first_ad_place" data-platform-desktop="true"></figure>
Copied to clipboardNote.If the turbo-ad-id attribute is not specified or its value is missing, only the first ad block is displayed at the bottom of the Turbo page.
If the turbo-ad-id attribute is specified only for some ad blocks, the ads aren't displayed.