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:
- Enable E-commerce in counter settings. Data container name —
dataLayer(default). - Pass events via JavaScript
dataLayer.push(). Bitrix out of box supports Google Enhanced Ecommerce viasale.order.ajaxcomponent, 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
- Pixel installation (Yandex + one ad channel) in template.
- ViewContent, AddToCart, Purchase transmission via
dataLayer. - Event verification via debuggers (Yandex Tag Assistant, Facebook Pixel Helper, Google Tag Assistant).
- Retargeting audience setup in ad cabinet.







