Ads on websites
Site structure
A site is an object in the Adfox system where ad campaigns are placed. There are sections with a set of placements on the site. In Adfox terminology, for example, adfox.yandex.ru is a site.
A site section is part of a site that's logically distinct in terms of topic, method of selling banner placements, subdomain, or any other characteristic. For example, a site may have the following sections: Home, News, and About. You can usually distinguish site sections by the URL mask.
Sections allow you to select different sets of placements on pages of the same site and serve different ad campaigns.
Placements are where you place banners on a site page. A placement is determined by banner type and location.
Add a site, section, and placement
Note
If you plan to place ads on a site under a contract with an advertiser or agency to display them in Russia and transfer data about these ad impressions to the Russian state register (ERIR) through the Yandex advertising data operator, then, before adding the site, enter information about the contractor (site owner) in the Marking tab. For more information, see How to register creative content in Adfox.
Add a site
-
Go to the Inventory tab in the main menu.
-
Click Add or Add site (if you haven't added any sites yet). Set the site parameters in the form:
- Name.
- Status: Active or stopped.
- Site owner.
- Category.
-
If needed, enable the Transfer the site to the ERIR option (for more details, see How to register creative content in Adfox). Fill out the fields in the Marking section:
- Platform type: Site, app, or information system.
- Name: Website name to be added to the ad register.
- Site URL: Website or video resource domain, blog URL, or URL for downloading an app that starts with
http://orhttps://. - Contractor: Counterparty (domain, video resource, blog, or app owner) that you added in the Marking tab earlier.
-
Click Save.
Add a section
Sections are created based on the ad placement logic:
- If ads are sold with placement on the entire site, you can create just one section: All pages.
- If you need to place ads on certain site pages, we recommend that you add multiple sections based on the site structure, for example: Home, News, and Cars.
Note
It's best to add placements after creating all the sections. If you want to use the same placements in different sections, you don't have to create them manually. You can create one, and then use the copy function.
-
Add a section in one of the following ways:
- From the add site form: After you save the new site, a form to create a new section opens automatically.
- From the site list: In the Inventory tab, find the site and click Sections under its name. In the window that opens, click Add.
- From the site page: Go to the Sections tab under the site name and click Add.
-
In the form that opens, set the section parameters:
-
Name.
-
Category.
-
If needed, enable the Dynamic definition by REFERER option.
Note
For codes received from the site level, sections with the Dynamic definition by REFERER option disabled are excluded from the search for a suitable URL mask.
-
Allowed page URLs: Specify the page URL masks according to your selected template type that determine whether the site pages belong to this section.
Alert
You can't specify the same page templates for different site sections.
-
Excluded page URLs: Specify the page templates that shouldn't belong to this section.
-
To check whether you set up the URL templates correctly
1. Copy the URL of the site page that you want to check.
2. In the Adfox interface, go to the Inventory tab and select the site where you want to check the section templates.
3. In the Sections tab, insert the site page URL in the URL by template box and click Find.
The system shows the section where the site page URL currently belongs according to the available page templates.
- Click Save.
Add a placement
-
Add a placement in one of the following ways:
- From the add section form: After saving the new section, a form to create a placement opens automatically.
- Go to the full section list and click Placements under the name of the section.
- Go to the site where you want to add a placement and select the Placements tab.
-
Click Add. Set the placement parameters in the form:
-
Name.
-
Banner type: Determines the type of placement to be added. Only the banners that you add with the same banner type are displayed on this placement.
-
Position: Determines the logical positioning of the placement on the section pages. If you add multiple placements with the same banner type to one section, use a unique position for each placement (meaning you can't add two placements with identical Banner type and Position parameters to one section).
Alert
After saving the placement, you can't change the Position parameter.
-
Category: Specify a permanent category for collecting statistics on impressions in certain site content categories.
-
Code type: Use this setting to allow serving particular ad campaign types on this placement. Acceptable values:
-
From request URL (default): The code type is determined by the parameter value obtained from the URL of the banner request. If the value isn't passed in the request, the placement is considered to have the “regular” code type by default.
-
Regular: Banners from all ad campaigns can be served, except for session campaigns. If multiple ad tags are installed on a site page for this placement, that page may have duplicate banners and campaigns.
-
Unrepeatable banners: Multiple ad tags are added to the site page for this placement. Based on their requests, a corresponding number of banners is selected, except in session campaigns. Banners can be selected from one ad campaign or from different ones.
What unrepeatable banners look like
For example, this is what ads served across three ad tags from a single Unrepeatable banners placement might look like.

-
Session campaigns: Banners from session campaigns can be selected for impressions and have priority over regular campaigns. If there are no session campaigns to be served, a regular ad campaign is selected.
-
unrepeatable campaigns: Multiple ad tags are added to the site page for this placement. Based on their requests, a single banner per ad campaign is selected, except for session campaigns. Only one banner from one ad campaign can be displayed per page load.
Note
If there are more ad codes than the number of ad campaigns placed on the placement, the system displays as many banners as there are ad campaigns.
Example
Four ad campaigns are running on the placement, each containing multiple banners, and five ad tags are installed on the page. In this case, one banner from each campaign is served for the first four ad tags, and a placeholder is shown in response to the fifth tag.
-
-
Number of impressions per period: Control the number of impressions across all ad campaigns served on the placement for a unique user.
-
Number of impressions per period: Number of banner impressions on this placement.
-
For period. Acceptable values:
- From request URL (default): The impression limit settings will be inherited from the banner request's URL parameters. If no values are passed in the request, the placement is considered to have no limits.
- No limits: Banner impressions on this placement aren't limited even if the request parameters specify otherwise.
- 1 hour/6 hours/12 hours/24 hours: The limit is valid for 1/6/12/24 hours after the banner is first served to a unique user.
- Others: You can set your own time period for the impression limit in minutes. Enter your custom period below in the Other period (minutes) field.
How impression limits work
Let's set a limit of three impressions per hour.
When the banner is shown to a unique user, the limit period begins. When the number of impressions within the set period (one hour) reaches the limit (three impressions), this placement stops banner impressions for the unique user until the period expires.
Note
To enable the Number of impressions per period setting, contact support.
The impression limit applies for all ad campaigns placed on this platform. If you selected the by event impression count method, banner ad responses are limited.
-
-
-
Click Save.
Add placements for a site with an adaptive layout
Adaptive sites are sites that have a stable HTML layout with CSS styles to help display it in different screen resolutions. An adaptive layout makes the site easy to view on various devices: mobile phones, tablets, and desktops.
Adfox supports three layout options: for mobile phones, tablets, and desktops.
The set of ad placements on each version may differ, for example:
- For phones: A stretching banner.
- For tablets: A stretching banner and a 100 x 100 banner.
- For desktops: A stretching banner and a 240 x 400 banner.
In this case, you need to create custom nondimensional banner types for each layout version in the Adfox interface. Then, create a site and sections and add 5 placements to each section (a stretching banner for phones, a stretching banner for tablets, a stretching banner for desktops, a 100 x 100 banner for tablets, and a 240 x 400 banner for desktops).
Next, get 5 ad tags with the “adaptive” code type.
Each ad tag only requests a banner in the suitable layout version.
Serving ads on CSP-enabled websites
To serve ads on your site, place the ad unit code within the HTML of your site's pages. Sites that support Content Security Policy only execute this embed code under special circumstances. Specifically, the browser must be granted permission via the HTTP header to process data, which includes permission to display ads, load images, and use styles.
Add the following code to the HTTP header:
Content-Security-Policy:
default-src 'none';
connect-src 'self' blob: yastatic.net *.yandex.net *.adfox.ru *.yandex.ru yandex.ru yandex.com;
frame-src yandexadexchange.net *.yandexadexchange.net yastatic.net *.yandex.ru *.adfox.ru;
img-src 'self' *.yandex.net *.adfox.ru *.yandex.ru yandex.ru yandex.com data:;
media-src yastatic.net *.yandex.net *.yandex.ru *.adfox.ru yandex.ru yandex.com blob: data:;
script-src 'unsafe-inline' 'unsafe-eval' yastatic.net *.yandex.ru *.adfox.ru yandex.ru yandex.com verify.yandex.ru;
style-src 'unsafe-inline' 'unsafe-eval' yastatic.net *.adfox.ru;
font-src 'self' yastatic.net data:;
For img-src, we recommend adding an array of *.yandex.ru subdomains. This way, you won't have to change your settings in the future.
-
The HTTP header directives script-src and style-src should receive the nonce attribute. This attribute must contain a string value composed of a random sequence of Latin characters and numbers. This value must be randomly generated on the server, independently for each request.
Content-Security-Policy: script-src 'nonce-<character sequence>'; style-src 'nonce-<character sequence>' -
Paste the following code into the HTTP header:
Content-Security-Policy: default-src 'none'; connect-src 'self' blob: yastatic.net *.yandex.net *.adfox.ru *.yandex.ru yandex.ru yandex.com; frame-src yandexadexchange.net *.yandexadexchange.net yastatic.net *.yandex.ru *.adfox.ru; img-src 'self' *.yandex.net *.adfox.ru *.yandex.ru yandex.ru yandex.com data:; media-src yastatic.net *.yandex.net *.yandex.ru *.adfox.ru yandex.ru yandex.com blob: data:; script-src 'nonce-<character sequence>' 'unsafe-inline' 'unsafe-eval' yastatic.net *.yandex.ru *.adfox.ru yandex.ru yandex.com verify.yandex.ru; style-src 'nonce-<character sequence>' 'unsafe-inline' 'unsafe-eval' yastatic.net *.adfox.ru; font-src 'self' yastatic.net data:;For
img-src, we recommend adding an array of *.yandex.ru subdomains. This way, you won't have to change your settings in the future. -
Add the value of the nonce attribute generated in the first step into the code of each Adfox unit on your site.
<div id="adfox"></div> script nonce="<character sequence>"> window.yaContextCb.push(()=>{ Ya.adfoxCode.create({ ...
Searching, viewing, and managing objects
Searching
To find an object, go to the Inventory tab in the main menu and enter the object name or ID in the search bar. You can narrow your search to sites, sections, or placements using filters: click the
icon and set the parameters.
Site parameters
-
Total ad requests: With or without ad requests.
-
Impressions: With or without impressions.
-
Ad format: Determined by the banner type of placements added within the site or section. Corresponds to the subsections of the Monetization section:
Banner type
Content
Display Advertising
Placements with nondimensional banner types (predefined or custom).
Video Advertising InStream
On desktop devices, SmartTVs, and app WebViews: placements with XML banners (predefined or custom).
In apps with the integrated Yandex Mobile Ads SDK: Placements with XML banners (predefined).
In-app ads
Placements with nondimensional banner types (predefined) and an integrated Yandex Mobile Ads SDK.
Native advertising and recommendation widget
Placements with nondimensional Native advertising banner types (predefined or recommendation widget).
-
Banner type: Custom or predefined, banner size.
-
Status: Active or stopped.
-
Category: Search by category from the list.
-
Site owner: Search by owner from the list.
Section parameters
-
Total ad requests: With or without ad requests.
-
Impressions: With or without impressions.
-
Ad format: Determined by the banner type of placements added within the site or section. Corresponds to the subsections of the Monetization section:
Banner type
Content
Display Advertising
Placements with nondimensional banner types (predefined or custom).
Video Advertising InStream
On desktop devices, SmartTVs, and app WebViews: placements with XML banners (predefined or custom).
In apps with the integrated Yandex Mobile Ads SDK: Placements with XML banners (predefined).
In-app ads
Placements with nondimensional banner types (predefined) and an integrated Yandex Mobile Ads SDK.
Native advertising and recommendation widget
Placements with nondimensional Native advertising banner types (predefined or recommendation widget).
-
Status: Active or stopped.
-
Template URL: Search by URL for sections with the Dynamic definition by REFERER option enabled.
Placement parameters
-
Total ad requests: With or without ad requests.
-
Impressions: With or without impressions.
-
Ad format: Determined by the banner type of placements added within the site or section. Corresponds to the subsections of the Monetization section:
Banner type
Content
Display Advertising
Placements with nondimensional banner types (predefined or custom).
Video Advertising InStream
On desktop devices, SmartTVs, and app WebViews: placements with XML banners (predefined or custom).
In apps with the integrated Yandex Mobile Ads SDK: Placements with XML banners (predefined).
In-app ads
Placements with nondimensional banner types (predefined) and an integrated Yandex Mobile Ads SDK.
Native advertising and recommendation widget
Placements with nondimensional Native advertising banner types (predefined or recommendation widget).
-
Banner type: Custom or predefined, banner size.
-
Position: Search by location.
-
Status: Active or stopped.
You can search for sections with the Dynamic definition by REFERER option enabled by their template URL: click the
icon, select the Template URL filter, and enter the URL.
Viewing
In the site, section, and placement lists, you can change the order of the columns (except for the first one) and hide any column you don't need by clicking the
In all lists, you can set the number of objects displayed per page. Select the number using the Display by parameter at the bottom of the page.
Managing objects via the menu
In the lists of sites, sections, and placements, you can open an object's context menu by clicking the
icon. The menu allows you to:
- Copy the object.
- Pause or resume ad delivery for the object and all its nested objects.
- Go to object parameters.
- Go to sections or placements (for sites).
- Go to placements (for sections).
- View banners (for placements).
- View the ad tag.
- Go to reports.
- Set up monetization (for sites only).
- Delete the object.
Managing ad impressions
In the Parameters tab, you can manage ad impressions for sites, sections, or placements using the Status option. This lets you quickly block impressions without manually deleting ad tags, pause campaigns and banners, or disable placements. You can also change the status in the context menu: click the
icon next to the object and select a status.
This setting applies hierarchically to all nested objects. For example, if you set a section's status to Paused, ad impressions will stop for all nested placements. This will not affect other sections of the same site. This status does not affect the status of campaigns, banners, or their placement.
Available statuses:
-
Active (default): The object and its nested child objects are active, and ad campaigns are being served.
-
Paused: The object and its nested child objects are inactive, and ad campaigns are not being served.
If the Paused status is selected, the ad engine returns a 404 error for all ad requests to this object and any nested objects.
Contact support
You can use categories to:
- Group sites, sections, or placements by topic and get statistics on impressions and clicks for the entire category.
- Mark up the audience for targeting by behavior.
Created by the user manually, with special templates added to them later.
They are provided by the system together with preset templates.