Configuring a Feed for Google Shopping in 1C-Bitrix
A Google Shopping feed is an XML file in the Google Merchant Center format with required product attributes. In Bitrix it is generated either through the "Catalog Export" module or via a custom script. The standard Bitrix export profile is not suitable for Google Shopping out of the box — a profile for the Google Base XML Schema is required.
Setup via the Built-in Export Module
In the admin panel: Catalog → Export → Create Profile. Select "YML" or "Custom XML" and configure the mapping manually.
Limitation of the standard export: it does not support the xmlns:g namespace required for Google Shopping. For a correctly formatted feed, using a custom script is easier.
Custom Feed Generation Script
The script is placed at /local/cron/google_feed.php and run by a cron job every 2–4 hours. The output is written to /upload/feeds/google.xml.
// Key properties that need to be mapped from the catalog
$PROPERTY_MAP = [
'brand' => 'BRAND', // "Brand" property
'barcode' => 'BARCODE', // EAN/barcode
'article' => 'ARTICLE', // Article number/MPN
'color' => 'COLOR', // Color (for clothing)
'size' => 'SIZE', // Size (for clothing)
'material'=> 'MATERIAL', // Material
];
Property mapping is the first step, done before writing the script. Verify that the required properties exist and are populated using CIBlockProperty::GetList(['IBLOCK_ID' => $IBLOCK_ID]).
Handling Trade Offers (SKUs)
For a catalog with trade offers (sizes, colors), each offer is exported as a separate <item> with the g:item_group_id attribute:
// Get trade offers for an element
$offers = \CIBlockElement::GetList(
[],
['IBLOCK_ID' => $OFFERS_IBLOCK_ID, 'PROPERTY_CML2_LINK' => $elementId, 'ACTIVE' => 'Y'],
false, false,
['ID', 'NAME', 'CATALOG_QUANTITY', 'CATALOG_PRICE_1']
);
while ($offer = $offers->GetNextElement()) {
$offerFields = $offer->GetFields();
$offerProps = $offer->GetProperties();
// g:item_group_id = ID of the parent element
// g:id = ID of the trade offer
// g:color, g:size — from the offer's properties
}
Automatic Update via Bitrix Agent
Instead of cron — a Bitrix agent for feed generation:
// Register the agent
\CAgent::AddAgent(
'\Local\Feed\GoogleFeedGenerator::generate();',
'local.feed',
'N',
3600, // every hour
'',
'Y',
date('d.m.Y H:i:s', time() + 3600)
);
Validating the Feed Before Submitting to Merchant Center
Diagnostic tools:
-
Google Merchant Center → Products → Diagnostics— status of each product -
Google Rich Results Test— checking structured data on pages - Feed validator:
https://validator.w3.org/feed/+ manual verification of required fields
Setup Timeline
Setting up feed generation with catalog property mapping, trade offer support, and automatic updates via agent — 1–2 business days. Including resolution of initial errors in Merchant Center.







