Configuring a Feed for Yandex Market (Product Advertising) in 1C-Bitrix
Yandex Market accepts feeds in YML format (Yandex Market Language) — XML with its own schema. Bitrix has a built-in YML export module, but for product advertising (Performance), the data completeness requirements are higher than for a simple listing. An incomplete feed means some products are excluded from advertising, and Google Shopping-style campaigns perform worse due to missing attributes.
YML Format for Yandex Market
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2024-01-15 10:00">
<shop>
<name>Store Name</name>
<company>Company LLC</company>
<url>https://your-site.com</url>
<currencies>
<currency id="USD" rate="1"/>
</currencies>
<categories>
<category id="1">Electronics</category>
<category id="2" parentId="1">Smartphones</category>
</categories>
<offers>
<offer id="123" available="true">
<url>https://your-site.com/catalog/product-123/</url>
<price>14990</price>
<oldprice>17990</oldprice>
<currencyId>USD</currencyId>
<categoryId>2</categoryId>
<picture>https://your-site.com/upload/img/product-123.jpg</picture>
<name>BrandName Model X 128GB Smartphone</name>
<vendor>BrandName</vendor>
<vendorCode>MODEL-X-128</vendorCode>
<barcode>4607086560001</barcode>
<description>Product description</description>
<sales_notes>Free shipping on orders over $50, free in-store pickup</sales_notes>
<param name="Storage">128 GB</param>
<param name="Color">Black</param>
<param name="Warranty">12 months</param>
</offer>
</offers>
</shop>
</yml_catalog>
Built-in Bitrix YML Export
In the admin panel: Catalog → Export → Add Profile → Yandex Market (YML).
Profile settings:
- Select the catalog infoblock
- Property mapping:
BRAND → vendor,ARTICLE → vendorCode,BARCODE → barcode - Filter: active products with non-zero stock only
- File path:
/upload/yandex_market.yml
The standard export cannot correctly export <param> tags from infoblock properties without customization. Product parameters (Storage, Color, Size) are critical for product advertising — Yandex uses them to match search queries.
Export Customization: Adding <param> from Properties
// /local/php_interface/init.php — hook on offer XML row generation
\Bitrix\Main\EventManager::getInstance()->addEventHandler(
'catalog',
'OnGetYmlOfferXml',
function (\Bitrix\Main\Event $event) {
$offer = $event->getParameter('OFFER');
$xml = $event->getParameter('XML');
// Add parameters from infoblock properties
$paramProps = ['COLOR' => 'Color', 'MEMORY' => 'Storage', 'SCREEN_SIZE' => 'Screen diagonal'];
foreach ($paramProps as $propCode => $paramName) {
if (!empty($offer['PROPERTIES'][$propCode]['VALUE'])) {
$xml .= sprintf(
'<param name="%s">%s</param>',
htmlspecialchars($paramName),
htmlspecialchars($offer['PROPERTIES'][$propCode]['VALUE'])
);
}
}
return new \Bitrix\Main\EventResult(
\Bitrix\Main\EventResult::SUCCESS,
['XML' => $xml]
);
}
);
Custom YML Feed Generator
If the standard export is insufficient — a fully custom generator:
// /local/cron/yandex_market_feed.php
$categories = getIblockSections($IBLOCK_ID);
$tmpFile = tempnam(sys_get_temp_dir(), 'yml_');
$xml = new XMLWriter();
$xml->openUri($tmpFile);
$xml->startDocument('1.0', 'UTF-8');
// ... generate yml_catalog structure
For large catalogs (>50K products), use XMLWriter with streaming output — do not accumulate a DOM in memory.
Common Feed Upload Errors
-
Invalid date format in yml_catalog— the date must be inYYYY-MM-DD HH:MMformat -
Duplicate offer ID— when trade offers and base products are exported with identical IDs -
Invalid XML character— ampersand&in a name is not escaped (&) -
Missing required tag price— products without a price are not exported; Yandex rejects them
Setup Timeline
Setting up the standard Bitrix YML profile with property mapping and adding <param> via hooks — 4–8 hours. A custom generator for a complex catalog with trade offers and parameters — 1–2 business days.







