Setting up a feed for Google Shopping in 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

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.