Yandex Metrica for WordPress — Complete Setup Guide

Yandex Metrica for WordPress site
Yandex Metrica setup via WordPress plugin — all settings in one window

You launched a WordPress site. Content is ready, images are uploaded, plugins are set. Now the real question: who visits your site, what do they read, where do they click, and why do they abandon the cart without buying? Yandex Metrica is the tool that turns your website from a black box into a glass cube. You see every visitor: where they came from, which pages they visited, where their mouse moved, what they clicked, and at which step they gave up.

The problem is that many website owners either never install an analytics counter or do it haphazardly — they copy the code from the Metrica interface, open the theme header.php file, paste it somewhere, and a month later update the theme, losing the code entirely. The result: six months of website operation and empty statistics. Sound familiar? Let us figure out how to install Yandex Metrica on WordPress once and for all — using a dedicated plugin that prevents the counter from being lost under any circumstances.

What Yandex Metrica Is and Why Your WordPress Site Needs It

Yandex Metrica is a web analytics service by Yandex that tracks website traffic and user behavior. Unlike Google Analytics, which was the de-facto standard for a long time, Metrica offers several unique features that make it indispensable for sites targeting Russian-speaking audiences.

The killer feature of Metrica that competitors have failed to properly replicate is Webvisor. This technology records visits to your site as video. You literally watch the screen alongside the user: you see where their cursor moves, what they click, how they scroll, what they highlight, and where they try to click. No summary table gives you this level of insight into user behavior.

\u{201c}

Webvisor is like a surveillance camera in a store. You do not just see the sales figure — you see the process: where the customer stopped, what they picked up, and what they put back. Only for your website.

Beyond Webvisor, Metrica provides you with:

  • Click map — a heatmap of all clicks on the page, showing hot and cold zones;
  • Scroll map — how far down the page visitors scroll and where they lose interest;
  • Form analytics — which form fields cause difficulties, at which step users abandon filling;
  • Traffic source reports — search engines, social media, direct visits, email campaigns;
  • Demographics and geographics — gender, age, city, and interests of your audience.

Yandex Metrica vs Google Analytics 4 vs Matomo — Comparison

The web analytics market today features three main players, each solving a different problem. To help you decide which tool fits your needs, let us compare them side by side.

FeatureYandex MetricaGoogle Analytics 4Matomo (on-premise)
Session recording (Webvisor)Built-in, freeNo (separate services only)Via paid plugin
Click and scroll mapsBuilt-in, freeNoBuilt-in
Real-time dataInstant (seconds)24-48 hour delayInstant
Data thresholdingNo thresholdYes (hides rare values)No
Data ownershipOn Yandex serversOn Google serversOn your server
Offline conversion importAPI + CSV uploadVia Measurement ProtocolVia API
Ad platform integrationYandex DirectGoogle Ads, Display NetworkOwn ad platforms
PriceFreeFree (GA4)Free (self-hosted)

As the table shows, Yandex Metrica wins on behavioral analysis while Google Analytics 4 excels at e-commerce reporting depth. For a WordPress site with a Russian-speaking audience, the optimal approach is to use both simultaneously: Metrica for understanding user behavior and GA4 for marketing reports.

To install Yandex Metrica you need a Yandex account. If you have a Yandex email — the counter is already available. If not — register at metrika.yandex.ru, it takes a couple of minutes.

Installing Yandex Metrica on WordPress — Step-by-Step Guide

Step 1. Creating a counter in Yandex Metrica

Before installing the plugin, you need to create the counter itself:

  1. Go to metrika.yandex.ru with your Yandex account;
  2. Click Add counter;
  3. Fill in the fields: counter name, site address (make sure to include https:// protocol), timezone;
  4. Accept the user agreement and click Create counter;
  5. On the Settings tab, select Asynchronous code — important for site loading speed;
  6. Copy the counter number (digits in the data-id attribute or in the browser address bar).
The counter number looks like an 8-digit number, e.g. 12345678. This is what you need for the WordPress plugin — you do not need to copy the entire JavaScript code.

Step 2. Installing the Yandex Metrica plugin in WordPress

Now go to the WordPress admin panel and install the plugin:

  1. In the admin menu, go to Plugins → Add New;
  2. In the search bar, type Yandex Metrica or Ya.Metrica;
  3. Find the plugin by Yandex, Alexander Semikashev, or Konstantin Kovshenin (most popular and stable versions);
  4. Click Install, then Activate;
  5. After activation, a new menu section appears — usually Settings → Yandex Metrica.

Several plugins exist for integrating Metrica with WordPress. Here is a comparison of the three most popular ones:

PluginAuthorFeaturesRating
Yandex MetricaKonstantin KovsheninMinimalist, counter insertion only, no extra settings4.5/5
Ya.MetricaAlex GoiaExtended: goal configuration, role exclusion, Webvisor 2.04.7/5
WP Yandex MetrikaAlexander SemikashevMost feature-rich: in-dashboard reports, widget, goals, forms4.8/5
If you only need a counter — pick the first one. If you want to configure goals and view reports directly in the WordPress dashboard — choose the third one. They differ in functionality but all three solve the basic task.

Step 3. Plugin configuration

After activating the plugin, set it up:

  1. Go to plugin settings (menu Settings → Yandex Metrica);
  2. Paste your counter number in the corresponding field;
  3. Choose code placement: Header (recommended) or Footer. In the header, the counter loads earlier and measures bounces more accurately;
  4. Enable Webvisor — this activates visitor action recording;
  5. Enable Asynchronous code — the code loads in parallel with content, not slowing down the site;
  6. Check Do not track administrators — so your own visits do not distort statistics;
  7. Click Save changes.
Never paste the counter code into theme files like header.php or footer.php manually. The next time the theme updates (and themes update 5-10 times a year), the code disappears and you lose your data. Use a plugin or a child theme only.

Step 4. Verifying the counter works

The fastest way to check if the counter works is to open your site in a new tab, then go to Yandex Metrica and check the Reports tab. If the Visits column shows one — the counter is working. Alternative method: open the browser console (F12 → Network tab), refresh the page, and look for a request to mc.yandex.ru. If such a request exists — data is being sent.

Goal Configuration in Yandex Metrica for WordPress

The counter by itself shows nice charts, but the real magic begins with goal setup. A goal is a user action you consider valuable: submitting a form, clicking a button, downloading a file, visiting a specific page.

Goal types in Yandex Metrica

Currently there are 4 goal types available. Each solves a different task depending on your site type:

  • Page views — depth. For example, a user viewed 3 pages per visit — goal achieved. Perfect for content sites and blogs;
  • Page visit — URL goal. The user landed on the Thank You For Your Order page — goal achieved. Classic for online stores;
  • JavaScript event — the most flexible goal. Fires on button click, form submission, scroll to a specific block. Implemented via ym(XXXXXX, 'reachGoal', 'TARGET_NAME');
  • Composite goal — step sequence. Example: Home → Catalog → Product Card → Cart → Checkout. Shows at which step users drop off.
\u{201c}

JavaScript events are your primary tool for conversion tracking. Learn to configure them once and you will be able to count any action on your site: from clicking a Buy button to scrolling to the very bottom of the page.

Configuring a JavaScript Event Goal on WordPress

Let us go through the JS event setup using a Submit Application button as an example. Two stages: in Metrica and on the site.

In Yandex Metrica:

  1. Open counter settings → Goals tab → Add goal;
  2. Name: Application submission;
  3. Type: JavaScript event;
  4. Goal ID: e.g. form_submit (Latin characters, no spaces);
  5. Click Add goal.

On the WordPress site:

If you use the WP Yandex Metrika plugin by Semikashev, JS events can be added directly through the admin panel: in plugin settings there is a Goals section where you select the CSS selector of the element (e.g. .form-submit-btn) and set the goal ID. The plugin automatically adds the click handler.

ym(12345678, 'reachGoal', 'form_submit');

If your plugin does not support visual goal configuration — add this code to the click handler of the desired button via the theme scripts file or a JS code insertion plugin. Make sure to replace 12345678 with your actual counter number.

After setting up a goal, always verify it fires. Open your site, perform the target action, wait 3-5 minutes, and check the Conversions report. If the goal is registered — everything works.

Webvisor 2.0 — What Is New and How to Use It

In 2024, Yandex introduced Webvisor 2.0 — a significantly improved version of its flagship tool. Unlike the classic Webvisor which simply recorded a screencast of actions, the second version fully rebuilds the page DOM tree and plays back user interaction at the document structure level.

What Webvisor 2.0 provides:

  • Session recording with preserved real scroll speed and mouse hover behavior;
  • Display of the exact cursor path, not just click coordinates;
  • Interactive player with slow-motion and fast-forward playback;
  • Text search within recorded sessions — find sessions where the user typed a specific word in a form;
  • Session filtering by characteristics: OS, browser, region, traffic source.

To enable Webvisor 2.0, go to counter settings in Yandex Metrica, find the Webvisor tab, and switch the version. If your WordPress plugin supports Webvisor 2.0 — a corresponding option appears in the settings. Note that Webvisor 2.0 requires more resources for recording and storage, but for most sites the difference is negligible.

Data Privacy and Yandex Metrica

In the age of GDPR and privacy regulations, any data collection raises questions. Yandex Metrica is no exception. Let us cover the main points.

Yandex Metrica collects the following visitor data:

  • IP address (anonymized — the last octet is zeroed out);
  • Browser User-Agent (type, version, OS);
  • Screen resolution and color depth;
  • Traffic source (referrer);
  • Page behavior (clicks, scrolling, form filling — what is visible in Webvisor).
Webvisor can record data entered by users in forms: names, phone numbers, emails. To prevent collection of personal data through Webvisor, configure field masking in counter settings — specify CSS selectors or name attributes of fields whose content should be hidden during recording.

According to the agreement, data is aggregated and used to improve Yandex services. You can disable the use of data for advertising purposes in counter settings by unchecking Send data to Yandex to improve ad quality. Metrica also supports the Respect Do Not Track option — when enabled, the counter will not send data about visitors whose browsers have this setting turned on.

Advanced Settings: Filters, Notifications, API

Basic counter installation does not exhaust Yandex Metrica capabilities. Advanced users will appreciate these features:

  • Traffic filtering — exclude visits from specific IP addresses, User-Agents, or referrers. Useful for filtering out bots and your own visits;
  • Problem notifications — Metrica can send emails if the site goes down, traffic drops sharply, or uptime degrades. Configured on the Notifications tab;
  • Yandex Metrica API — allows exporting data to your own analytics systems, CRM, or dashboards. Through the API you can retrieve statistics on visits, sources, goals, demographics;
  • Segments — custom user groups for detailed analysis: e.g. visitors from Moscow arriving from search who placed an order. Combine with any report.

Frequently Asked Questions

How does Yandex Metrica differ from Google Analytics?

The key difference is that Metrica shows real-time data while GA4 has a 24-48 hour delay. Metrica Webvisor records visitor sessions as videos — a feature Google Analytics simply does not have. Click maps, scroll maps, and form analytics come built into Metrica for free. Metrica also handles Runet-specific traffic sources better and does not apply data thresholds that GA4 uses to hide low-volume results.

Do I need to edit WordPress theme files to install the Metrica counter?

No. When using a plugin, no theme file editing is required. The plugin automatically inserts the counter code into the site header or footer, and the counter continues working even after switching or updating the theme.

Does Yandex Metrica slow down website loading?

With proper configuration — almost zero impact. Modern Metrica code loads asynchronously and does not block page rendering. Use the Async Code option in plugin settings and disable automatic navigation data sending (hit) if it is not needed for your analysis.

What is Webvisor and why do I need it?

Webvisor is a Yandex Metrica tool that records all visitor actions on your site as video: mouse movements, clicks, scrolling, form filling. It lets you see exactly how a real user interacts with your site — where they get stuck, what they ignore, which form fields cause errors. It is the best tool for UX auditing without hiring expensive specialists.

What goals can I configure in Yandex Metrica for WordPress?

Four goal types are available: URL goals (visiting specified pages), JavaScript events (button clicks, form submissions, file downloads), composite goals (step sequences like checkout funnels), and page depth goals (number of pages per visit). The plugin simplifies JS event setup through a visual constructor.

Does Yandex Metrica share data with third parties?

According to Yandex user agreement, data collected by Metrica is used to improve Yandex services but is not shared with third parties in raw form. However, anonymized statistics may be used in Yandex advertising products (Direct, YAN). You can disable this option in counter settings.

Can I use Yandex Metrica and Google Analytics simultaneously?

Yes, this is recommended for sites with Russian-speaking audiences. Metrica provides detailed behavioral analytics and session recordings, while GA4 offers more advanced e-commerce reports and Google Ads integration. Both counters coexist perfectly in a single plugin.

Will the Metrica code disappear when switching WordPress themes?

If added via a plugin — no. The plugin inserts the counter independently of the active theme, and it remains in place after switching. If you manually pasted code into the header.php or footer.php theme file — the code will be lost when the theme changes.

How does Yandex Metrica calculate bounce rate?

By default, a bounce is a visit where the user viewed only one page and spent less than 15 seconds on the site. This threshold can be adjusted in counter settings. Unlike GA4 where a bounce is a visit without engagement events, Metrica allows flexible bounce criteria tailored to your site specifics.

Do I need a plugin if I can paste the code manually?

Manual insertion works, but a plugin provides several advantages: protection against code removal during theme updates, visual goal configuration without JavaScript editing, automatic insertion on all pages, header/footer placement control from the admin panel, and counter disabling for administrators.

Conclusion

Yandex Metrica is a must-have tool for any WordPress site targeting Russian-speaking audiences. With a plugin, installation takes exactly 5 minutes, and the result is a complete picture of your visitor behavior. Webvisor shows where users get stuck, the click map reveals where they try to click, and goals tell you how many of them made it to purchase.

Do not skimp on analytics. Install the counter today, and in a month you will be surprised by how many new things you learn about your own site.

Open

Tap to react