Why use Tag Manager for Metrica
Google Tag Manager is often seen as a tool for Google products only, but it is really a container for any script. GA4, the Meta pixel, the Metrica counter and other tracking codes can all be launched from it. For a business owner, that means one control panel where you can see what fires on the site and when.
Speed is the second benefit. Adding a goal such as a click on your Telegram link doesn't require a developer ticket or a site release. And every change is saved as a version, so if leads suddenly drop after an edit, you can roll the container back.
- All counters and pixels are managed in one place
- Goals are configured without touching site code
- One trigger can send data to both GA4 and Metrica
- Every change is versioned and can be reverted
Method 1: a custom HTML tag
This is the most direct route. Create a counter in Metrica and copy its code. In Tag Manager, add a tag of the Custom HTML type and paste the full code. Use an All Pages trigger, preferably one that fires as early as possible during page load.
Then switch on Preview mode, open your site and confirm the Metrica tag fires on every page. Only after that, publish the container. Changes that are saved but not published do not work on the live site, and that is behind many cases of "it worked in preview".
Method 2: a template from the gallery
The template gallery includes community-made Metrica templates. You enter the counter number and tick the options in a form instead of pasting code. It looks convenient, but a template is still someone else's code running on your site, including checkout pages.
Check the author, the reviews and the date of the last update before using one. If in doubt, take the code straight from the Metrica interface so you know exactly what is inside it.
Counter options and goals
When you paste the code, keep the options you need, such as Webvisor, click maps and form analytics. They are defined inside the code, so whenever you change counter settings in Metrica, update the code in the container too.
For JavaScript-event goals, create a separate custom tag in Tag Manager that calls the reachGoal method with your counter number and a goal identifier. The same identifier must be set in the goal inside Metrica. Attach triggers to actions that matter to the business:
- a click on a phone number
- a click on a Telegram or WhatsApp link
- a successful lead form submission
- a click on a "Buy" or "Place order" button
Single-page sites and visit parameters
On sites where sections change without a page reload, Metrica will only record the first page view by default. Turn on hash tracking in the counter settings, or send page views manually using a browser history change trigger. Then click through the sections and check that new views appear in the reports.
You can also pass visit parameters through the container, such as page language, catalog section or customer type, which helps with segmentation. Do not send phone numbers, names or email addresses as parameters. It breaks the service rules and puts your customers' data at risk.
Testing and common mistakes
Test in four steps: Tag Manager Preview, Metrica's debug mode in the browser, the real-time report, and a test run of every goal. Don't skip the last one, because goals are where most errors hide.
The usual problems look like this:
- the Metrica code is left in the site template as well as the container, so visits are counted twice
- the tag fires late and some quick visits are lost
- the goal identifier in the tag differs from the one in Metrica
- the goal fires on a button click even if the form failed validation
- the container version was never published
- a cookie consent banner blocks the container and part of the traffic disappears
Trade-offs and who should own the container
There is a downside. Metrica becomes dependent on the container: if it is deleted or disabled by accident, the counter stops too. Loading through a container can also be slightly slower than code placed directly in the template. For most sites the benefits still outweigh these costs.
Give publishing rights to one responsible person who understands both Metrica and GA4. If several contractors work in the same container, agree on a procedure and describe every version. If you would rather not do this alone, markdev sets up end-to-end analytics and reporting for businesses in Uzbekistan, from counters and goals to CRM and ad connections. Send us your site and the question you need answered, and we will suggest where to start.
FAQ
Can I install Yandex Metrica through Google Tag Manager?
Yes. Tag Manager can run any script, so the counter is added either as a Custom HTML tag or through a template from the gallery.
Why does Metrica count my visits twice?
Most often the counter code sits both in the site template and in the container. Keep only one and verify the result in Preview mode.
My goal is set up but doesn't show in Metrica. Why?
Check that the goal identifier matches in the tag and in Metrica, that the container version is published, and that the trigger fires in Preview.
Do single-page sites need extra setup?
Yes. Enable hash tracking or send page views on a history change trigger, otherwise Metrica will only see the first page.
Let’s look at your task for free
Leave your contact — in a 15-minute call we’ll show where leads get lost and what to fix first.