Setting up retargeting on 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
    1189
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    813
  • 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
    657
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Retargeting Setup for 1C-Bitrix

Visitor viewed product card, added to cart, and left. Without retargeting, you lose them forever. With retargeting — show them that exact product in ads within an hour. Technically, the task reduces to passing e-commerce events to ad pixels. Let's configure for major platforms: Yandex, Google, Meta (Facebook), VK.

Which Events We Pass

Retargeting platforms work with audiences segmented by actions. Minimum event set:

Event When Triggered What We Pass
PageView Every page URL, title
ViewContent Product card product_id, name, price, category
AddToCart Added to cart product_id, quantity, price
InitiateCheckout Checkout start cart total, items count
Purchase Order placed order_id, total, products[]

More events — more precise segmentation. But ViewContent, AddToCart, Purchase are sufficient to start.

Pixel Installation

Yandex.Metrica + Yandex.Audiences. Metrica counter already installed on most sites. For retargeting, need:

  1. Enable E-commerce in counter settings. Data container name — dataLayer (default).
  2. Pass events via JavaScript dataLayer.push(). Bitrix out of box supports Google Enhanced Ecommerce via sale.order.ajax component, but Yandex needs custom format.

ViewContent event for Yandex:

window.dataLayer.push({
    ecommerce: {
        detail: {
            products: [{
                id: "<?= $arResult['ID'] ?>",
                name: "<?= CUtil::JSEscape($arResult['NAME']) ?>",
                price: <?= $arResult['MIN_PRICE']['DISCOUNT_VALUE'] ?>,
                category: "<?= CUtil::JSEscape($arResult['SECTION']['NAME']) ?>"
            }]
        }
    }
});

Place in catalog.element component template — template.php or included JS file.

Google Ads (gtag.js). Google Tag pixel installed via gtag('config', 'AW-XXXXXXXXX'). For retargeting pass page_view automatically, e-commerce events — via gtag('event', 'view_item', {...}).

Bitrix has native Google Enhanced Ecommerce setup in catalog module (Settings → Product Settings → Catalog → E-commerce). When enabled, catalog and cart components automatically form dataLayer in GA4 format. If using gtag.js instead of GTM — data captured automatically.

Meta Pixel (Facebook/Instagram). Pixel code added to <head> via site template header.php or Google Tag Manager. Events:

fbq('track', 'ViewContent', {
    content_ids: ['<?= $arResult['ID'] ?>'],
    content_type: 'product',
    value: <?= $arResult['MIN_PRICE']['DISCOUNT_VALUE'] ?>,
    currency: 'RUB'
});

VK Pixel. Similarly: VK.Retargeting.ProductEvent(PRICE_LIST_ID, 'view_product', {products: [{id: '...', price: ...}]}).

AddToCart Transmission — Bitrix Nuance

Adding to cart in Bitrix usually happens via AJAX request to basket.php or component catalog.element. JavaScript event must be called in callback after successful addition. Intercept standard Bitrix event:

BX.addCustomEvent('OnBasketChange', function() {
    // Get last added product from response
    dataLayer.push({
        event: 'add_to_cart',
        ecommerce: { add: { products: [/*...*/] } }
    });
});

If using custom AJAX — wrap callback manually.

Dynamic Retargeting: Product Feed

For showing specific products in ads (dynamic retargeting), ad platforms require product feed — XML/CSV with catalog. Product ID in feed must match content_ids / product_id in site events.

Bitrix generates feeds via Marketing → Export to Google Merchants / Yandex.Market. For Facebook and VK, custom export or standard adaptation needed. Key — unified product ID everywhere.

Google Tag Manager as Alternative

Instead of inserting pixel codes directly in templates, use GTM. Bitrix forms dataLayer, GTM routes data to all platforms (Google Ads, Yandex, Meta, VK) without code changes. Adding new ad channel — one tag in GTM, no dev changes.

What We Configure in One Day

  1. Pixel installation (Yandex + one ad channel) in template.
  2. ViewContent, AddToCart, Purchase transmission via dataLayer.
  3. Event verification via debuggers (Yandex Tag Assistant, Facebook Pixel Helper, Google Tag Assistant).
  4. Retargeting audience setup in ad cabinet.