Enabling a 1C-Bitrix module

  1. Installing and setting up the module
    1. Getting started
    2. Step 1. Installing the module
    3. Step 2. Setting up the module
    4. Step 3. Checking if data is sent
  2. Additional settings
    1. How to fill in the “Brand Property” field in the module settings
    2. How to transmit information about product views (the detail property)
  3. License agreement
  4. Updating the module

The Yandex Metrica team developed an official free-of-charge module for installing a web analytics tag on a website. The module runs on 1C-Bitrix version 18.0 and higher, and supports all “1C-Bitrix: Site Management” editions.

“Yandex Metrica” module features:

Installing and setting up the module

  1. Getting started
  2. Step 1. Installing the module
  3. Step 2. Setting up the module
  4. Step 3. Checking if data is sent

Getting started

  1. If you don't have a Yandex Metrica tag yet, create one. Make sure the correct website URL is specified in the tag settings. To check this, go to the Yandex Metrica Settings page. Pay attention to the Address field value: it should show the URL of the website where you want to install the module.
  2. In the tag settings, enable the E-commerce option. A container for collecting data from dataLayer will be added to the code snippet by default.

  3. Make sure no similar module that installs a Yandex Metrica tag is activated in 1C-Bitrix. To do this, go to the admin panel and open Marketplace → Installed solutions and look for a module with the name “Yandex Metrica”, “Metrica”, or “Metrika”. If there is one, delete it.

Step 1. Installing the module

Go to the 1C-Bitrix admin panel, log in, and add the module using one of the following methods:

Through the admin panel
  1. Open Marketplace → Installed solutions, and find the module with the name “Yandex Metrica”.
  2. Click the icon and select Install.

Via 1C-Bitrix: Marketplace
  1. Go to 1C-Bitrix: Marketplace, and find the module with the name “Yandex Metrica”.
  2. Open the module and click Install.
Using a ZIP archive
  1. Download the installation ZIP archive with UTF8 or CP1251 encoding.
  2. Go to the 1C-Bitrix admin panel on the Content page.
  3. Select Files and folders → bitrix → modules and open the last page of the module list.
  4. Click Upload → Add file and select the ZIP archive with the Yandex Metrica module.
  5. Click Save. The archive will be uploaded to the modules catalog on your server.
  6. Unpack the archive: find it in the list of modules, click and select Unpack. Make sure the yandex.metrika catalog appeared in the list.
  7. Open Marketplace → Installed solutions, and find the module with the name “Yandex Metrica”. Click and select Install.

Step 2. Setting up the module

  1. Go to Settings → Product settings → Module settings → Yandex Metrica.
  2. Select the website.
  3. Enter the number of the tag installed on your website. If the plugin detects a Yandex Metrica tag on the website, the fields will be filled in automatically. Check if their values are correct. How to find the tag number
  4. By default, the Session Replay option is enabled. It records user sessions so that you can analyze statistics in more detail. If necessary, you can disable Session Replay at any time.
  5. Save your changes.



Tip. The Brand Property field is not obligatory. Fill it in if you want to track statistics on the brand of goods in Yandex Metrica. For example, which brand is most popular with customers.

In addition, to get more detailed statistics about products (for example, which products users view most often), configure the detail event.

Step 3. Checking if data is sent

To check if data is sent to Yandex Metrica:

E-commerce data appears in Yandex Metrica a few hours after it is first sent. To view the e-commerce reports, in Yandex Metrica, open Reports → E-commerce. Learn more about the reports.

Data about sessions and pageviews appears in Yandex Metrica when the first website sessions occur after you install the module. To view statistics, go to Yandex Metrica and open Reports. For more information about working with reports, see Setting up and viewing a report.

Additional settings

  1. How to fill in the “Brand Property” field in the module settings
  2. How to transmit information about product views (the detail property)

How to fill in the “Brand Property” field in the module settings

You can send information about the brands in your online store to Yandex Metrica. Based on this data, in Yandex Metrica a report is generated, which you can use to determine the most popular brand among customers or to find out which brand brings the most profit, for example.

Note. 1C-Bitrix templates can have several product catalogs. In the Yandex Metrica module settings, only the active directories' brand properties are displayed. We recommend filling in all the available Brand Property fields to ensure data is properly sent to Yandex Metrica.
To find a property value:
  1. Go to the 1C-Bitrix admin panel.
  2. Go to Content → Types of information blocks → Catalogs and select the catalog.
  3. On the right, open the Features tab.
  4. In the list, find the field for the brand.
  5. Specify the name of the field in the “Yandex Metrica” module settings.

How to transmit information about product views (the detail property)

You can send product viewing data to Yandex Metrica so that the e-commerce reports will contain more detailed information. For example, the Popular products report is formed in this way.

To set up the events responsible for product viewing, you need to make changes to the element.php file code of the bitrix:catalog component template on your website.

Attention. The path to the element.php file may differ in the templates of different sites.
  1. Log in to the website as an administrator.
  2. On the Website tab, turn on Editing mode.
    Note. If you have edited the template before, go to p. 6 of the instructions.
  3. On the website, open the product card and hover over the area of the catalog component: a menu will appear.
  4. Click , select the catalog, and then Copy the component template.
  5. In the Copy to the site template field, select current and save the changes.
  6. Find and open the element.php file. In the code, find the row that looks like this:
    $elementId = $APPLICATION->IncludeComponent('bitrix:catalog.element', 'bootstrap_v4', $componentElementParams,
        $component
    );

    If before the bitrix:catalog.element component you don't see "$elementId = ", add the variable to the code yourself.

  7. After it, add $APPLICATION->IncludeComponent("yandex.metrika:detail", "", array("PRODUCT_ID" => $elementId), $component);.

    Make sure that the register of variables and function names of the code detail matches the case of the element.php file variables.

    Code example
    ...
    $elementId = $APPLICATION->IncludeComponent('bitrix:catalog.element', 'bootstrap_v4', $componentElementParams,
        $component
    );
    $APPLICATION->IncludeComponent("yandex.metrika:detail", "", array("PRODUCT_ID" => $elementId), $component);
    ...
  8. Click Save.
How to find the element.php file
  1. On the Website tab, turn on Editing mode.
  2. On the website, open the product card and hover the cursor over the area of the catalog component: a menu will appear.
  3. Click , select the catalog, and then Copy the component template.
  4. Make sure that the element.php file is displayed in the window that opens. The path to the file is specified in the name of the window.

After the module is installed and set up, look at the error log. To do this, open the module in the 1C-Bitrix admin panel. You can ask any questions via the form below or on the 1C-Bitrix website (in the lower right corner, click Technical support).

Viewing common errors
  • Outdated version of 1C-Bitrix. Check if a new version is available and install it. To do this, in the admin panel, go to Marketplace → Platform update.
  • The brand property you specified is not on the website.
  • The tag number contains characters that are not digits.

License agreement

Read the License agreement for using the “Yandex Metrica” module for 1C-Bitrix.

Updating the module

When the module has a new version, a message about it will be displayed in the 1C-Bitrix admin panel. You can install an update in one of the following ways: