In-Image
Ads in In-Image units are displayed on top of site images, helping you monetize visual content. It's up to you to decide on which images to display ads. You can also customize the maximum frequency of impressions on the page.
In-Image units are linked to images inside the page content. The user can close the ad at any time.
Available formats
Standard unit size: 100% of the image width and 100 px in height.
Minimum image size:
- Width: 320 px.
- Height: 190 px.
Note that if one of the parameters has a smaller value, the unit is not rendered.
The following ad formats can be displayed in a banner:
-
Adaptive
-
Media ads of fixed and adaptive formats.
Example of displaying an In-Image unit
How to create an In-Image unit
-
In the Yandex Advertising Network interface, go to Ads on websites → Ad units and click New ad unit.
-
Select the site that you want to create an ad unit for and click Next.
-
Select the In-Image unit type.
-
Enter a unit name to be used in the Yandex Advertising Network interface.
-
Set the CPM floor:
-
Maximum revenue: Determine the minimum cost of impressions automatically. With this option, you can effectively fill placements and maximize revenue for the site owner.
-
CPMV floor: Set your own minimum cost per thousand impressions based on a viewability check. The CPMV floor is set in rubles, US dollars, or euros. You can change the floor currency in your account settings.
Alert
Setting a CPMV floor can reduce the unit fill rate and, therefore, decrease your income.
-
-
Select the Type of integration to distribute ads by:
-
Automatic (default): For all images that meet the minimum size requirements.
-
Allowed classes: For images with selected classes. Specify the classes of images to display ads. To add a class, type its name in the field that appears and press Enter.
Sample ad tag for an image
<img src="example.com/image.jpg" class="adv">
Where:
example.com/image.jpg
: Path to the image on the hosting service.adv
: Name of the class that the script uses to define whether ads can be rendered on the image.
-
Allowed identifier: For images marked with selected IDs. Specify the IDs of images on which ads can be displayed. To add an ID, type its name in the field that appears and press Enter.
Sample ad tag for an image
<img src="example.com/image.jpg" id="adv">
Where:
example.com/image.jpg
: Path to the image on the hosting service.adv
: Name of the ID that the script uses to define whether ads can be rendered on the image.
You can also set the following:
- Page limit: Maximum number of ad units to be displayed per site page.
- Limitation for images: Size of images on which to display ads. Make sure the values you set are greater than the minimum ones.
Warning
When you change the integration type, maximum number of units, or if you set new limitations, the ad tag for the unit is updated. If you made changes to a unit that is already placed on the site, get a new ad tag.
-
-
Choose a theme: Dark or Light. The default option is Light theme. Dark theme units have a different background and color scheme for their text, frame, buttons, and other elements. The selected theme is applied to all ad formats within the unit.
-
Choose how you want to configure ad formats:
-
Use standard settings: With this option, the unit shows ads of all available formats, such as Text & Image ads, display ads, and video ads. The design of ads and impression parameters are determined automatically.
-
Configure the formats: With this option, you can preview the unit on screens of different sizes:
Main designMedia adsVideo adsMain design applies to Adaptive
In Maximum ads, choose how many ads can be shown on an image. The default maximum value is
2
. In the preview area, you can emulate the unit with one or two ads for different devices.Media ads are served automatically based on the unit size.
You can't disable the format.
Video ads are selected automatically based on the image size. The minimum image area is 360 × 560 pixels. Video ads aren't displayed on images of a smaller size.
-
-
Click Create. A window with the embed code will open. Use this code to place the ad unit on your site.
Once you save the ad unit, it will be assigned a unique identifier (ID
). It consists of a product ID (R-A
), site ID (site_id
), and the unit's serial number.
How to add an In-Image unit to your site
-
Get the embed code: create a new unit or click Get code in the settings of an existing unit.
-
Copy the Yandex Advertising Network loader code to the clipboard. Paste the code inside the
<head>
tag of the page where you want to display an In-Image unit. The loader code is only embedded on the page once and is used to call all Yandex Advertising Network units. -
Insert the code for the In-Image unit before the closing
</body>
tag at the end of the page. The code works on desktop and mobile devices.Sample code with automatic integration to display In-Image units on your site
<!-- Yandex.RTB R-A-77777-77 --> <script> (function renderInImage(adImagesCounter, images) { if (adImagesCounter <= 0 || !images.length) { return } const image = images.shift() image.id = `yandex_rtb_R-A-77777-77-${Math.random().toString(16).slice(2)}` window.yaContextCb.push(() => { Ya.Context.AdvManager.render({ "renderTo": image.id, "blockId": "R-A-77777-77", "type": "inImage", "onRender": () => { renderInImage(adImagesCounter-1, images) }, "altCallback": () => { renderInImage(adImagesCounter, images) }, "onError": () => { renderInImage(adImagesCounter, images) } }) }) })(9, Array.from(document.querySelectorAll("img"))) </script>
Contact support
An impression is considered viewable if at least 50% of the unit area is in the visible area of the screen for at least two seconds.
320 px in width and 190 px in height.