Yandex.Metrica Integration

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Yandex.Metrica Integration

Yandex.Metrica is the primary web analytics tool for Russian websites. It provides clickmaps, webvisor (session recording), funnels, segments, and integration with Yandex.Direct.

Installation

<!-- Yandex.Webmaster meta tag separately, counter like this: -->
<script type="text/javascript">
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for(var j=0;j<document.scripts.length;j++){if(document.scripts[j].src===r){return;}}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");

ym(COUNTER_ID, "init", {
    clickmap: true,
    trackLinks: true,
    accurateTrackBounce: true,
    webvisor: true,
    ecommerce: "dataLayer"
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/COUNTER_ID" style="position:absolute;left:-9999px" alt=""/></div></noscript>

Goals

Goals are conversions that Metrica tracks. Goal types:

  • URL — visiting a page like /thank-you
  • JavaScript — calling ym(ID, 'reachGoal', 'goal_name')
  • CSS selector — clicking an element
  • Page view count
// Trigger a goal
ym(COUNTER_ID, 'reachGoal', 'order_placed', {
    order_id:    orderId,
    order_price: total
});

// Send user parameters
ym(COUNTER_ID, 'params', { user_id: userId, user_plan: 'pro' });

E-commerce via dataLayer

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
    ecommerce: {
        purchase: {
            actionField: {
                id:       orderId,
                revenue:  total,
                coupon:   couponCode
            },
            products: orderItems.map(item => ({
                id:       item.productId,
                name:     item.name,
                price:    item.price,
                quantity: item.qty,
                brand:    item.brand,
                category: item.category
            }))
        }
    }
});

SPA (React/Vue)

// On route change
router.afterEach((to) => {
    ym(COUNTER_ID, 'hit', to.fullPath);
});

Webvisor and Sensitive Data

Webvisor records user actions. Fields with passwords, card numbers, and personal data should be excluded:

<input type="password" class="ym-disable-keys" />
<input type="text" name="card_number" data-ym-disable-keys />

Setup time: a few hours for basic integration with goals and e-commerce.