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.pushinstrumentation incatalog.section,catalog.element,sale.basket.basket,sale.order.ajaxtemplates - GTM tags for all six funnel events with Data Layer variables
- Passing product SKUs (the
ARTICLEproperty), brands, and categories - Clearing the ecommerce object before each event







