Setting Up GA4 Goals and Events on 1C-Bitrix: A Step-by-Step Guide
Setting up 1C-Bitrix Google Analytics (GA4) requires manual configuration because standard 1C-Bitrix components do not generate events for GA4. Even the latest framework versions do not send purchase or add_to_cart into the dataLayer — this has to be implemented manually. This guide covers GA4 Bitrix setup, GA4 goals 1C-Bitrix configuration, dataLayer Bitrix integration, and more. On one project, we encountered that the GTM container only received page_view, and all conversions were simply lost. After an audit, it turned out that the sale.order.ajax and catalog.element templates lacked the ecommerce layer markup. The error cost the store 40% of untracked orders — that's direct revenue loss. Our setup starts from $500 and can save up to 30% in wasted ad spend due to untracked conversions. For example, one client recovered $2,000 monthly ad spend after proper tracking. Read on to see how we fixed it and what you need to know to avoid such problems.
How to configure GA4 on Bitrix in 5 steps
- Audit existing components – Identify which templates need modification (e.g., catalog.element, sale.order.ajax, main.feedback).
- Add dataLayer markup – Insert JavaScript that pushes events (view_item, add_to_cart, purchase, etc.) into the dataLayer array.
- Set up GTM container – Create tags, triggers, and variables for each event type. This is part of GTM 1C-Bitrix setup.
- Test with DebugView – Verify that events appear correctly in GA4 DebugView.
- Deploy and monitor – Publish the container and monitor real-time reports for one week.
Problems we solve
- Passing transaction data to GA4. The
sale.order.ajaxcomponent contains the order ID, amount, and cart contents — but this data does not reach Google Analytics. We create adataLayerarray with thepurchaseevent and an ecommerce object inresult_modifier.phpor a JS template. This addresses purchase tracking Bitrix. - Sending events from feedback forms. The
bitrix:main.feedbackcomponent has no built-in trigger for GA4. We useBX.onCustomEvent('onWebFormSuccess', ...)— subscribe in a global script and push thegenerate_leadevent. - Caching issues. If caching is enabled in a component, the
dataLayermarkup does not execute on every view. The solution is to use tagged caching or pass data via$APPLICATION->AddHeadScript.
How we do it
Stack: 1C-Bitrix (any edition), PHP 8.1+, GA4, Google Tag Manager, JavaScript (ES6+). For each project, we adapt standard components. We specialize in GA4 integration Bitrix and conversion tracking Bitrix for online stores.
Case: passing purchase data in an online store with a customized cart component. The client used sale.order.ajax without modifications — no checkout event reached GA4. We modified the component template: in result_modifier.php we added a PHP block that gathers transaction data and stores it in a global variable $ecommerceData. Then in the template's JavaScript file, on the BX.Sale.OrderAjaxComponent.onOrderCreated event, we push dataLayer.push with that data. After that, in GTM we created a trigger on Custom Event purchase and a GA4 Event tag configuration with parameters from the dataLayer. Debugging via GA4 DebugView showed that all events arrive correctly.
Why GTM is better than direct gtag?
GTM provides flexibility: you can modify tags without changing site code, add triggers based on dataLayer events, and use variables. Direct gtag is a rigid code binding. On one project, we migrated 15 events from gtag to GTM in 2 days — markup time decreased threefold. This is especially important for large catalogs where every conversion matters. According to Google's documentation, GTM is recommended for complex tagging schemes.
How to properly pass ecommerce data to dataLayer?
It's not enough to simply insert gtag('event', 'purchase', {...}) in a PHP template. This leads to mixing server-side and client-side code. We use a unified JavaScript buffer:
window.dataLayer = window.dataLayer || []; dataLayer.push({ event: 'purchase', ecommerce: { transaction_id: '<?= $arResult['ORDER_ID'] ?>', value: <?= $arResult['PRICE'] ?>, currency: '<?= $arResult['CURRENCY'] ?>', items: <?= CUtil::PhpToJSObject($arResult['BASKET_ITEMS_GA4']) ?> } }); Process overview
Steps for configuring GA4 on Bitrix
| Stage | Duration | Result |
|---|---|---|
| Requirements analysis | 0.5 day | List of conversions and integration points |
| dataLayer markup | 1-3 days | Modified component templates |
| GTM setup | 1 day | Tags, triggers, variables for each event |
| Debugging | 1 day | Confirmation of correct sending via GA4 DebugView |
| Deployment and instructions | 0.5 day | Working container and documentation |
Timeline and deliverables
Estimated timeline: 3 to 7 working days depending on the number of conversion types. Includes:
- dataLayer markup for all specified events (up to 5 types)
- GTM container setup with tags and triggers
- Debugging and error correction
- Instructions for adding new events
- 30 days of post-project support
We also provide documentation with the dataLayer schema and a list of used triggers. If you need GA4 events online store or google analytics 4 bitrix setup, contact us — we will evaluate your project for free. Request a consultation for an accurate timeline estimate.
Common mistakes in self-setup
| Mistake | Consequence | Solution |
|---|---|---|
| Sending gtag directly in PHP when caching is enabled | Events don't fire | Use JS buffer or AddHeadScript |
| Missing items array in ecommerce | GA4 does not count the purchase | Build items array with id, name, price, quantity |
| Conversions not marked in GA4 interface | Event not considered key | Manually mark as conversion |
| Using outdated gtag.js | No support for Enhanced Measurement | Migrate to GTM with GA4 template |
Guarantees and experience
Our specialists are 1C-Bitrix certified and have 7+ years of analytics setup experience. We have completed over 50 GA4 integrations on Bitrix, helping clients save thousands in ad spend. We guarantee that all selected conversions will be correctly transmitted to GA4. For an accurate cost and timeline estimate, get a consultation — we will respond within a day.

