Statistics in Yandex.Metrica (by widget)

You can use Yandex.Metrica to identify the level of user interest in widgets.

  1. Step 1. Create goals in Yandex.Metrica
  2. Step 2. Specify the Yandex.Metrica tag in the widget code
  3. Step 3. Create widgets in Yandex.Metrica

Step 1. Create goals in Yandex.Metrica

For a tag in Yandex.Metrica, add four goals with the type . If you have no tag installed on your site, create one and add a code snippet to the site pages.

Goal name Description Goal ID in Yandex.Metrica

Widget initialization

The goal is completed when a product search query is sent to Yandex.Market and the widget starts loading.

market_widget_init

Widget loading

The goal is completed when products are found on Yandex.Market and the widget loads on the page (in any part of the page, even outside the visible area).

market_widget_load

Widget display

The goal is completed when at least 50% of the widget area has been displayed in the active browser window for at least two seconds.

market_widget_show

Click on a widget

The goal is completed when the user clicks the widget and goes to a store's website, Yandex.Market, or Beru.

market_widget_click

For more information, see the Yandex.Metrica Help:

Step 2. Specify the Yandex.Metrica tag in the widget code

  • In the constructor: fill in the Yandex.Metrica tag field.
  • In the code: specify the metrikaCounterId parameter (for example, metrikaCounterId: 12345).

You can find the Yandex.Metrica tag number in the Settings menu.

Sample widget code
<script async src="https://aflt.market.yandex.ru/widget/script/api" type="text/javascript">
</script>
<script type="text/javascript">
  (function (w) {
    function start() {
      w.removeEventListener("YaMarketAffiliateLoad", start);
      w.YaMarketAffiliate.createWidget({
        containerId: "marketWidget1",
        type: "offers",
        params: {
          clid: 2310490,
          searchText: "Яндекс.Телефон",
          themeId: 2,
          metrikaCounterId: 12345
        }
      });
    }
    w.YaMarketAffiliate
      ? start()
      : w.addEventListener("YaMarketAffiliateLoad", start);
  })(window);
</script>
<div id="marketWidget1"></div>

Step 3. Create widgets in Yandex.Metrica

On the Dashboard page in Yandex.Metrica, add widgets to estimate statistics and conversions. All widgets have the “Metric” type.

Attention. Be sure to fill in both the Main and Segmentation tabs.
How to fill in the fields
Main → Name Main → Statistics Main → Goal Main → Metric Segmentation → Sessions in which

Widget initializations

Sessions

Widget initialization

  • Conversion rate: For widgets with conversions.
  • Goals reached: For widgets with statistics.

No

Widget loads

Widget loading

Conversions “Widget Initialization”

Widget displays

Widget display

Conversions “Widget loading”

Clicks on widgets

Click on a widget

Conversions “Widget display”