Setting up Enhanced Ecommerce in Google Analytics for 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

Setting Up Enhanced Ecommerce in Google Analytics for 1C-Bitrix

Enhanced Ecommerce is a set of specific events and objects that GA4 accepts for building a sales funnel: from product view to completed purchase. Without this instrumentation, GA4 has no reports on product lists, promo codes, or funnel behavior. On 1C-Bitrix stores, integration requires modifying catalog and cart component templates — there is no out-of-the-box solution.

The ecommerce object structure in GA4

Each event passes an ecommerce object with an items array. The minimum item structure:

{
  item_id: 'SKU_123',
  item_name: 'Product name',
  price: 1990.00,
  quantity: 1,
  item_category: 'Electronics',
  item_brand: 'Samsung'
}

Before each ecommerce event, the previous data must be cleared: dataLayer.push({ ecommerce: null }).

Instrumentation by 1C-Bitrix component

view_item_list — product list view (catalog.section):

In the component's result_modifier.php, build the items array from $arResult['ITEMS']:

$items = [];
foreach ($arResult['ITEMS'] as $item) {
    $items[] = [
        'item_id' => $item['PROPERTIES']['ARTICLE']['VALUE'] ?: $item['ID'],
        'item_name' => $item['NAME'],
        'price' => (float)$item['MIN_PRICE']['PRICE'],
        'item_category' => $arResult['SECTION']['NAME'],
        'index' => $item['INDEX'],
    ];
}
$APPLICATION->AddHeadString('<script>window.__catalogItems = ' . json_encode($items) . ';</script>');

In the template's JS file:

dataLayer.push({ ecommerce: null });
dataLayer.push({ event: 'view_item_list', ecommerce: { items: window.__catalogItems } });

view_item — product card view (catalog.element):

Same approach, but with a single item. Data is taken from $arResult['ITEM_PRICES'][0] and product properties.

add_to_cart / remove_from_cart — attached to the OnSuccessAdd2Basket / OnSuccessRemove2Basket events of the cart component.

view_cart — on load of the /basket/ page, data from the sale.basket.basket component via $arResult['BASKET_ITEMS'].

begin_checkout — when navigating to checkout from the cart.

purchase — the most important event, containing the final order data:

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: orderId,
    value: orderTotal,
    tax: orderTax,
    shipping: orderShipping,
    currency: 'USD',
    coupon: couponCode,
    items: orderItems
  }
});

Data for purchase is taken from the thank-you page template (sale.order.ajax in STEP=FINAL mode) or from $arResult of the sale.order.result component.

Enhanced Ecommerce funnel

Step GA4 Event Data source
List view_item_list catalog.section, $arResult['ITEMS']
Card view_item catalog.element, $arResult['ITEM_PRICES']
Add to cart add_to_cart OnSuccessAdd2Basket event
Cart view_cart sale.basket.basket, $arResult['BASKET_ITEMS']
Checkout begin_checkout Navigate to /order/
Purchase purchase sale.order.ajax, ORDER_ID

Debugging and verification

GA4 DebugView (real-time) shows each event with the expanded ecommerce object. Errors such as "missing required field" appear there as well. The Monetization → Ecommerce purchases report starts populating 24–48 hours after correct setup.

What we configure

  • dataLayer.push instrumentation in catalog.section, catalog.element, sale.basket.basket, sale.order.ajax templates
  • GTM tags for all six funnel events with Data Layer variables
  • Passing product SKUs (the ARTICLE property), brands, and categories
  • Clearing the ecommerce object before each event