Integrating Yandex.Metrica Enhanced Ecommerce with 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.
Showing 1 of 1All 1626 services
Integrating Yandex.Metrica Enhanced Ecommerce with 1C-Bitrix
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • 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
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Integrating Yandex.Metrica Enhanced Ecommerce with 1C-Bitrix

We often encounter a situation where an online store owner on 1C-Bitrix assumes that simply installing a Metrica counter is enough—and sales data already appears in reports. In reality, without Enhanced Ecommerce event transmission, analytics are limited to counting visits and clicks. Our task is to set up a full funnel: from product view to payment, with breakdowns by product, brand, and category. Enhanced Ecommerce is 3 times more accurate than the standard goal-based scheme because it transmits detailed data for each product. Let's look at implementing dataLayer events, debugging, and guaranteed server-side transaction sending.

How Enhanced Ecommerce Works

Yandex.Metrica receives transaction data through the dataLayer object—a JavaScript array into which the page pushes events. The Metrica counter reads events of a specific structure and sends them to Yandex servers. The main events: detail (product view), add (add to cart), remove (remove from cart), purchase (completed purchase). Each event contains an ecommerce object with a products array. A product is described by fields: id, name, price, brand, category, quantity, variant.

How to Implement dataLayer in 1C-Bitrix?

There is no built-in Enhanced Ecommerce integration in Bitrix—the sale module only sends the basic counter code. Implementation falls on the developer.

detail event — added to the catalog.element component template. In result_modifier.php or template.php, form the product array and push it to dataLayer:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
    "ecommerce": {
        "detail": {
            "products": [{
                "id": "SKU-1234",
                "name": "Product Name",
                "price": 2500,
                "brand": "Brand",
                "category": "Section/Subsection"
            }]
        }
    }
});

add event — fires when the "Add to Cart" button is clicked. In Bitrix, adding to cart typically goes via an AJAX request to sale.basket.basket. You need to intercept the successful response and push the event. The most reliable way is to subscribe to the custom JS event BX.onCustomEvent('OnBasketChange') or wrap the standard handler.

remove event — similar to add, fires when an item is removed from the cart. It is intercepted via the same OnBasketChange with analysis of the cart state difference.

purchase event — the most critical. It is formed on the "Thank you for your order" page (sale.order.ajax → confirmation template). Order data is taken from \Bitrix\Sale\Order::load($orderId):

window.dataLayer.push({
    "ecommerce": {
        "purchase": {
            "actionField": {
                "id": "ORDER-5678",
                "revenue": 7500,
                "shipping": 300
            },
            "products": [
                {"id": "SKU-1234", "name": "Product 1", "price": 2500, "quantity": 3}
            ]
        }
    }
});

Why Server-Side Sending via OnSaleOrderPaid Is Critical?

Relying solely on the client-side dataLayer is risky—the user may close the page before the script fires. For guaranteed transaction tracking, the OnSaleOrderPaid event handler is used. When the payment status changes to "Paid", a server-side script sends data to Metrica via the Measurement Protocol or writes them to a separate queue for subsequent upload via the offline conversions API. This approach eliminates data loss and prevents duplicate transactions. On one project for a large electronics retailer, we reduced transaction loss from 30% to under 2% after implementing server-side sending.

Technical Requirements for Server-Side Sending - PHP 8.1+ with cURL support - Bitrix version 21+ (uses D7) - Access to Yandex.Metrica counter settings (counter number and OAuth token) - OnSaleOrderPaid event handler in a custom module or in init.php

Setting Up Goals

In the Yandex.Metrica interface, create goals of the "JavaScript event" type to track specific actions:

Goal Identifier Trigger
Product view product_detail Product page load
Add to cart add_to_cart "Add to Cart" click
Checkout start begin_checkout Go to checkout page
Order completion purchase_complete Confirmation page

Goals are sent via ym(COUNTER_ID, 'reachGoal', 'add_to_cart') in parallel with dataLayer events. They complement ecommerce data and allow building composite goals for funnels.

Aspect Client-side dataLayer Server-side sending
Reliability Medium (depends on browser) High (guaranteed)
Latency Instant 1–5 minutes (offline conversions)
Duplication Possible on page refresh Eliminated via flag check
Product data Full Only ID and quantity

What's Included in Ecommerce Setup

We have been working with Bitrix for over 10 years and have completed more than 150 projects. The standard package includes:

  • Audit of current dataLayer structure and counter
  • Development of detail, add, remove, purchase events
  • Integration of server-side sending via OnSaleOrderPaid
  • Creation of goals and funnels in Yandex.Metrica
  • Testing on test and production environments
  • Training your manager on report usage
  • Documentation of implemented events

Debugging

Debugging Enhanced Ecommerce is the most labor-intensive phase. Tools:

Browser console — after each action, check the contents of window.dataLayer. The command JSON.stringify(dataLayer, null, 2) shows all accumulated events.

Yandex.Metrica → Visit Parameters — in the report "Content → Visit Parameters" you can see which ecommerce events Metrica recorded. Data appears with a 5-10 minute delay.

Tag Assistant by Yandex — a browser extension that shows in real time what data is being sent to the counter. It helps detect: missing required fields, incorrect price format (string instead of number), duplicate events.

Common errors:

  • Price transmitted as a string with spaces ("2 500" instead of 2500) – Metrica ignores such values.
  • purchase event fires on every refresh of the confirmation page – duplicates transactions. Solution: check the window.ecommerceSent flag or store the sent order ID in sessionStorage.
  • category contains full breadcrumbs instead of hierarchy via / – breaks the category report.
  • Ecommerce container not enabled in counter settings (Settings → Ecommerce → checkbox "Send ecommerce data").

Do you want to set up full sales analytics? Contact us — we will assess your project within one day. Get a consultation on Enhanced Ecommerce integration.

Why is 1C-Bitrix the flagship of e-commerce?

A faceted index on a catalog of 200,000 SKUs is not built — bitrix:catalog.smart.filter takes 4 seconds instead of 200 ms, and the customer leaves. Our online store development on 1C-Bitrix eliminates such scenarios: from infoblock architecture and price types to cluster balancing under peak loads. With over 12 years of experience and 200+ completed e-commerce projects, we have solved every performance bottleneck.

Two-way synchronization with 1C via CommerceML — catalog, prices, balances, orders, and statuses. Configured from the admin panel via the catalog module -> 'Exchange with 1C'. Export to marketplaces via YML feeds (catalog.export) for Yandex.Market, Google Shopping, Ozon, Wildberries. According to Wikipedia, 1C-Bitrix is used by more than 70,000 commercial sites in Russia and the CIS (https://en.wikipedia.org/wiki/1C-Bitrix). Contact us to evaluate your current architecture.

How do we solve key performance problems?

bitrix:catalog.smart.filter without faceted index generates queries that bring down MySQL. Solution: build b_catalog_iblock_index — response time drops from 4 seconds to 100–200 ms. For SEO filters, we use catalog.seo.filter — indexable filter intersection pages with unique meta tags.

Composite cache (bitrix:main.composite) speeds up page loading by 3–5 times compared to regular. Goal — product card TTFB < 200 ms. For sessions we use Redis (SESSION_SAVE_HANDLER = redis in .settings.php). Lazy load images, CDN for static, SQL optimization (especially JOINs on b_iblock_element_property). As noted in the official Bitrix documentation, composite cache delivers a page from HTML, bypassing PHP execution and database requests, giving a speed advantage of up to 5x.

Why is caching critical for an online store?

Each second of page load delay reduces conversion by an average of 7%. At TTFB > 400 ms, 32% of users leave the site. Composite cache delivers a page from HTML, bypassing PHP execution and database requests — this gives a speed advantage of up to 5 times. For product cards with frequent price and stock changes, we use tagged caching: invalidation occurs only for affected entities. In practice, we have reduced TTFB from 1.2 seconds to 180 ms. Time savings on catalog loading — up to 60%.

Store types and their features

Store type Key modules Features
B2C retail catalog.smart.filter, catalog.compare.list, reviews, ratings Faceted index, conversion funnel from card to payment
B2B wholesale dealer prices (b_catalog_group), min. lots, credit limits Personal accounts, quick order by SKU, PDF invoices
Digital goods licenses, subscriptions, files OnSaleOrderPaid -> automatic access granting
Marketplace "Marketplace" module or custom Multiple sellers, separate accounting, commission model
PWA / mobile Progressive Web App, React Native + REST API Offline catalog, push notifications

Integrations: payment systems, delivery, CRM, marketplaces

Payment systems. Handlers in sale.handlers: YooKassa, CloudPayments, Tinkoff, Sberbank, Apple Pay, Google Pay, installment. Callback sale.payment.notify for status confirmation. Delivery. Handlers sale.delivery for CDEK, Boxberry, Russian Post, DPD — real-time cost calculation via API, tracking. Warehouse management. Reservation (RESERVED = Y in b_sale_basket), automatic write-off upon shipment, notifications when stock falls below threshold, pre-order for goods in transit. CRM. Bitrix24 or amoCRM — orders from b_sale_order are sent automatically, client base is synchronized. Triggers: abandoned cart, review request, reactivation. Marketplaces. Export via YML to Ozon, Wildberries, Yandex.Market. Orders flow into a single system. Analytics and marketing. GA4, Yandex.Metrica, email newsletters (Unisender, SendPulse). Logistics. MyWarehouse, Antor — labels, picking lists.

Migration from other CMS

Migration from OpenCart, WooCommerce, Shopify, MODX: transfer of catalog (elements, properties, sections, images, SEO-URLs), migration of client base (b_user) and order history (b_sale_order), 301 redirects via urlrewrite.php. Parallel operation during the transition period — old site sells, new one is accepted. Team experience — 50+ migration projects.

Example migration: from OpenCart with 50,000 products We transferred all data, including custom attributes and review history, in two weeks with zero downtime. The new store was tested in parallel before switching DNS. Result: 25% faster page load and 15% increase in sales.

What is included in the work (deliverables)

Deliverable Description
Technical specification Business requirements, catalog structure, integrations, cart logic
Infoblock architecture Price types, properties, sections, HL-blocks, ORM entities
Components and templates Custom or adapted standard (Component 2.0)
Integrations Payments, delivery, CRM, marketplaces, 1C
Documentation Content filling instructions, REST API, DB schema
Team training Working with admin panel, exports, updates
Warranty Free support 3 months after launch, bug fixes

Stages and timelines

Average project duration — 2 to 4 months:

  1. Analytics (1–2 weeks) — business requirements, catalog structure, integrations, technical specification
  2. Design (2–3 weeks) — prototypes, design system, layouts
  3. Development (4–8 weeks) — components, templates, integrations, content
  4. Testing (1–2 weeks) — functional, load, acceptance
  5. Launch (2–3 days) — deployment, monitoring, operational support

Budget range: from $10,000 for a basic store to $60,000+ for a complex marketplace with multiple integrations. Clients typically see a 20–30% increase in conversion after optimization. Contact us for a precise estimate — we tailor the solution to your specific catalog size and business logic.

Loyalty program and conversion

Bonus system: points for purchases, reviews, recommendations. Accrual rules by categories, points payment limit, expiration period — all in personal account. VIP levels (bronze, silver, gold, platinum) with increased cashback and free shipping. Recommendations 'You may also like', 'Complete your purchase' — built-in Bitrix tools + RetailRocket or Mindbox. Triggers: birthday discount, promo code for return, interest chain. Personalization via catalog.recommended.products and catalog.viewed.products. A/B testing of two card variants on real traffic. Enhanced E-commerce in GA4 and Yandex.Metrica — full path from click to return visit.

Request a free technical audit of your current store. Our engineers will identify performance bottlenecks and migration risks. Order turnkey online store development — get a ready solution with warranty and support.