Where is it better to insert the Yandex metric code. Yandex.Metrica - what kind of animal and how to tame it. Step by step instructions for setting up. Installing the Yandex Metrica counter

From the author: I welcome you dear readers. For each site owner, the attendance of his project is the most priority issue, which means that after indexing, it is advisable to place a special counter on all pages that will record the exact number of visits to your site by users. Therefore, in this lesson we will consider how to set the metric on Joomla.

A hit counter is a specific script that is designed to evaluate website traffic. That is, it counts the number of visitors who came to a particular site. As a rule, the counter consists of two parts:

Data collection code that is added to the common blocks for all pages of a specific site.

The logical part that calculates the received information.

In fact, the logic and code of the counter can be quite simple and you can easily create it yourself, provided that you are familiar with the PHP programming language. But in given time created great amount various services that provide ready-made website traffic counters for use. In this case, it is enough to register your own account and receive the code for inserting the counter on the site. We will talk about just one of these services in this article, namely, how to install Yandex metrics on a Joomla site.

Yandex.Metrika is completely free service, designed to evaluate site traffic, to add which, it is enough to add a special JavaScript code to a specific location on the site. In addition to simply counting the number of users, this service allows you to group site users according to various parameters, measures the conversion of the site and online advertising, and also offers a mechanism for constructing reports for a more convenient analysis of traffic.

So, as mentioned above, the Yandex metric on Joomla can be added by simply adding the code that will be generated when creating the counter. So, we follow the link to home page service.

I would like to draw your attention to the fact that in order to work with the counter, you need Account search engine Yandex. Next, you need to create a counter, for this, click on the “Add counter” button.

On the next page, we indicate the name of the future counter, the domain of the site on which it will be used, the time zone and the time of user inactivity, after which it is considered that he left the site. After that, to save the counter, click on the “Create counter” button.

Modern trends and approaches in web development

Learn the algorithm for rapid growth from scratch in website building

To get the Metrics embed code, go to the “Counter code” tab.

At the same time, we check the “Asynchronous input” option, so the data about visitors will be sent to the server without reloading the page, that is, asynchronously. And also, if it is necessary to display the results of calculations on the site in the form of a special informer, activate the “Informer” parameter. Then, in the text area at the bottom, the service provides the code that activates the counter on your site. The appearance of the informer can be changed using the "Customize" button.

Having finished with the settings, copy the counter code for subsequent insertion into the site template code. Please note that the Metrica code, as a rule, should be available on absolutely all pages of the site, which means that it must be added to the general block for all pages. The footer can serve as such a block.

Now let's go directly to the question - how to add Yandex metrics to the joomla site. So, go to the directory of the active template, in my case it is beez3, and open it in text editor index.php file.

This file is the main template file that defines its structure and plug-in positions. This means that at the very bottom, the code of the file, footer blocks are formed - where we will add the copied code of the newly created counter.

Hello, friends. Do you already have a blog, you fill it with content and want to know how many people follow you? Then it's time to install on the site counter Yandex Metrica and I'll show you how to do it below. Go!

Installing Yandex Metrics

We go to the page metrica.yandex.ru. Click the "Add counter" button.

On the next page, enter the counter name and site domain and click "Create". Then go to the "Counter code" tab.

I recommend checking the following boxes:

  • Webvisor - allows you to monitor user behavior. Useful feature!
  • Asynchronous code - the counter will not slow down the loading speed of the site. We put;
  • In one line - will reduce the size, but make the code unreadable. For an amateur;
  • Informer - usually placed in the footer. Shows statistics to all visitors to your site. I don't bet.

On the Webvisor tab:

  • Record pages when viewed by a visitor - disabled (Needed for online stores);
  • Writing pages by a robot- turned off;
  • Loading pages into the player is not important (I have it on behalf of an anonymous user).

We will analyze goals and filters later, now the main thing for us is to understand how to install Yandex Metrica.

After the above settings, click the "Save" button on the right and return to the "Counter Code" tab. Click the "Copy to clipboard" button and paste this code into the footer of our blog. If you don't know how, read on.

Where to insert the Metrica code?

I will show 2 ways how to add the code.

Via FTP

For me, this is the easiest way. At the root of your site, go to the theme folder, most often it is located at “/wp-content/themes/theme_name” and find the “footer.php” file there. Open it and paste the counter code before the closing tag and don't forget to save.

Through the WordPress admin

The second method is suitable if you do not have access to FTP - set the counter via WordPress admin area. To do this, go to the admin panel in the "Appearance - Editor" section, find the file "foter.php" (May be called "Footer") in the list on the right and add it to the end before the tag counter code.

Now a new one has appeared on the page with your counters, someone has the first one. We go into it and analyze all the statistics of our blog.

In the next tutorial I will show you how to install Google counter Analytics. On this I apologize. Good luck!

Every day, thousands of new sites of various directions and topics appear on the Internet, but the ultimate goal of each of them is to inform the audience about goods, services, companies, world news and much more.

Yandex.Metrica is a free tool for assessing the behavior of the audience on the site and analyzing traffic sources, which displays information in colorful reports, graphs, charts and clearly shows everything that users have done on the site. Yes, yes, Yandex.Metrica contains videos of user visits to your site! They allow you to evaluate not only on which areas of the page the user spent the most time, where he clicked and which page he went to next, but also to evaluate how the site was displayed on the device of this particular user.

The main data contained in Yandex.Metrica reports

  • Traffic sources– where did the audience come from: search, advertising, social network, newsletter, etc.
  • The audience– demographic, geographic data, engagement and loyalty indicators.
  • Conversion report- how many purchases, form submissions on the site, clicks, views were made by site visitors, by what audience and from what source.
  • Technology- data on user devices (PCs, smartphones, tablets), OS, screen resolution from which the visit was made.
  • Monitoring data- load on the site, page loading time, site health check results.
  • E-Commerce Data(for online stores) - a summary of orders, purchase amounts, popular products, and more.

Otherwise, the owners of sites that do not have web analytics counters will not be able to get information about where the audience comes to their site from, in what quantity, what quality, and, importantly, they will not be able to determine which channel is the most cost-effective.

Registering and configuring the counter

Installing and configuring the Yandex.Metrica counter does not take much time. Below we will step by step analyze how to register, install and configure a web analytics system for a site.

Next, you need to create a counter. To do this, click on the yellow button "Add counter" and get to the page for registering a new counter.

63.64KB

In field Website address enter the site domain without http/https. For example, site.ru or site.ru/category/ - if you want to set a separate counter for a section or page of the site.

You can also specify additional site addresses if you plan to create a single counter for several sites, or set the “Accept data only from specified addresses” setting so that information is displayed in reports only for your site:
25.53KB

We select the time zone according to the location of the company - for the accuracy of data in the reports on the date and time of visits.

Next, we activate the collection of information for reports on the webviewer, scroll maps, clicks and form analytics - these reports include detailed records of visitor actions on the site: mouse movements, page scrolling and clicks.

Put a tick in the checkbox "I accept the terms user agreement” and click on the “Create counter” button in the lower left corner.

After that, a screen appears with additional settings and a counter code that must be installed on all pages of your site (or on a specific section if you create a separate counter for a specific section).

Additional counter settings

By clicking on the heading " Additional settings» a list appears in which you can set additional options:

  • Tracking the hash in the address bar of the browser. The option is applicable for AJAX sites. This technology is rarely used and in most cases the checkbox is left empty.
  • asynchronous code. This setting is active by default and is responsible for ensuring that the counter code does not affect the page loading speed of your site and does not block it.

    The asynchronous code looks like this:

    With the option disabled, the code will look like this:

    The "Asynchronous code" option is disabled in the code

  • For XML Sites there are separate requirements for the counter code, so for such sites you need to check the corresponding checkbox, which will remove tags from the counter code
  • In one line» is responsible for the type of counter code. With this option enabled, the code will look like this:

    "In one line" setting reduces the appearance of the code
  • Prohibition of submission for indexing of site pages. This setting is necessary if you do not want your site's pages to be indexed by search engines. The setting is similar to the ban on indexing through the robots.txt file. Useful when the site is not yet ready for publication and contains test or blank sections. If you turn off this setting in the future, you will need to copy the new counter code from the field from this page and update the code on the site.
  • informer. If you enable this setting, an icon with information about your site traffic will be displayed in the footer (bottom) of the site. In the additional settings of the informer, you can select the icon size, color and type of data that will be displayed. The data will be available to everyone who has visited your site and scrolled the page to the footer.

  • Alternative CDN. This option allows you to correctly account for visits from regions where access to Yandex.Metrica is restricted. This option may reduce the download speed of the counter code, but even with the "Alternative CDN" enabled, the counter code can send a preliminary request to mc.yandex.ru to save traffic.
  • Sending e-commerce data to Metrica. An important setting if you have an online store. The option allows you to connect Ecommerce through the interface and collect data on the number of orders, the amount of purchases, etc. If the option is enabled, by default the JavaScript array is named dataLayer. You can change it in the field Data container name. Read more about connecting an online store to Yandex.Metrica on the Yandex.Help page.
  • Currency. The setting is responsible for the currency in which the data on the cost of the order and the average check will be displayed in e-commerce reports. Choose the option that is used on your site - if the cost of goods is presented in rubles - choose the Russian ruble.
  • Visit timeout in minutes. The amount of time a user has been idle on your site before the visit is considered completed. The default timeout is 30 minutes. But if you post long videos on the site that users will watch without making any mouse actions, then for the correct collection of information, it is recommended to increase the timeout (by how much - you need to proceed from the duration of the videos on your site). The maximum time that can be set is 360 minutes.

This completes the additional settings. In most cases, only the Asynchronous code option will be active in this section and, if the counter is configured for an online store, the last item responsible for sending e-commerce data.

Important point! If you have made any changes to the "Additional settings" after you installed the counter on the site, you need to update the code on the site page, because. each setting adds or removes lines and characters in the counter code.

Therefore, the counter code on the settings page is displayed at the bottom, under all settings. It is in a black container.

Click on the yellow button Copy code and for convenience save it in text txt file.

On the settings page, scroll down and click on the “Start using” button.

But before data is collected in reports, the counter code must be installed on your site.

Installing the code on the site

There are several installation options available:

  • add to html code,
  • install through CMS widgets and website builders,
  • through tag management systems.

HTML code

Open the template code on the site and add a counter within the tags or as close to the top of the page as possible: this way it will load earlier and be able to send browsing data to Yandex.Metrica, even if the visitor closes the page almost immediately.

If the site uses several templates, add the counter code to each of them.

Then we open the site in the browser and check that the code is present on the pages. To do this, use the key combination Ctrl + U to open the site code, scroll the page and look for the counter code with your eyes. Or we launch the search bar on the page with the key combination Ctrl + F, enter Metrika in Latin, press Enter and look at the result - if the counter was added successfully, you will see it in the code:

CMS Widgets and Website Builders

Option 1. For some systems, there are ready-made plugins. Usually, in the plugin, it is enough to specify only the number of your counter, in our case - 49906027. It can be found next to the name in the general list of counters.

Option 2. If there is no plugin, the counter code must be inserted into the field for an arbitrary html block. Read more about installing the counter code via CMS or website builder in Help.

Tag management systems

Google Tag manager: create a new tag with the Custom HTML template, insert the Metrica counter code into it. Don't forget to add the "All pages" trigger so that the counter code is loaded from any page of the site.

Other tag management systems provide a similar field for inserting arbitrary html code. And in Tealium, integrated with Metrica, it is enough to indicate the number of your counter in the corresponding field.

After you have successfully installed the code on your site, in the list of Yandex.Metrica counters, next to the name of your counter, the icon will change from yellow to green.

Hello, dear readers of the blog site. Today we will talk about a new visible counter of visits (having an informer), which over time, perhaps, will be able to somewhat shake the ultra-reliable position of the most popular on this moment in runet. I mean the informer that Metrica has recently introduced.

When I created my first site, I really wanted to put a counter on it from . Got this request in search engine, looked through many resources, but it turned out to be just a myth, although many did not fail to advance on this fairly popular request. I remember that it was through him that I first got to Devaki's blog. Highly useful resource By the way, I advise you to visit.

Yandex counter - myth or reality?

But still, progress this request at that time, because such a thing did not exist in nature. Many have given him away. Well, starting from the fall of 2009, it was possible, almost without a twinge of conscience, to issue a web analytics tool called Yandex Metrika to the counter, which, in general, was such.

But still, it was somewhat different from the popular LiveInternet, which, in addition to fairly powerful web analytics tools (rather not even analytics, but still statistics), had an informer visible to site visitors, where one could, if desired, configure the output of traffic data in any form convenient for the webmaster .

It was exactly such an informer that Metrika lacked for it to be completely called a counter. But this was relevant only until recently, and now you can talk about it publicly, because this system acquired a visible part that allows display on site pages information about the attendance of this resource.

When setting up the informer, you can choose one of these three options for displaying it on the site, as well as adjust the color scheme and what exactly should be displayed in it. For starters, I think it's good. I especially like the second option, which in the form of a step chart displays site traffic by day of the week - very original.

By the way, it will be possible to configure that when you click on the informer, a drop-down window appears with statistics for the previous week:

General Metric attracts with its visibility, beauty and other web zeros (WEb 2.0), especially against the backdrop of LiveInternet, which is still a bit of the last century in terms of presenting information and the visibility of its presentation, although, of course, the information it provides is very important and in some cases unique.

Let's hope that, finally, LI will have a worthy competitor in the face of Metrika and its visible hit counter, because competition is always good for the end user, i.e. for you and me, dear webmasters.

By the way, this system can be called a web analytics tool, because it has the ability to set goals and track certain events (for example, going to a certain page, registering, clicking on certain links, etc.).

In RuNet, the most popular tool for web analytics is still Google Analytics, which is quite heaped up and seriously surpasses Yandex Metrica in terms of capabilities.

But the question is that in Runet at the moment web analytics is in its infancy, unlike bourgeois (which, according to some reports, is ahead of the development of our SEO by about 5 years), where similar systems have become one of the most popular tools for website promotion.

In RuNet, Google Analytics is considered the coolest, and in bourgeois it is used only by novice optimizers. There, professional paid software is often used to analyze the progress of projects. Well, we are lagging behind the bourgeois and nothing can be done about it. Therefore, Metrica's web analytics capabilities will be enough for us in most cases.

In addition, the brainchild of the Runet mirror has such unique tools as Webvisor, a link or click map:

Well, now let's move on from praising Yandex and its new counter (I've been promoting their services too much lately) directly to how to get all this beauty on your site.

How to register and set up Yandex informer

Let me remind you that if you make money on your site by displaying ads from the Yandex Advertising Network (YAN), then along with the context block code, the Metrica code will also be loaded. Those. consider that you are already registered in this system, and in order to verify this, you can click on the appropriate link on the statistics page of your advertising platform in YAN:

I also remind you that if ads from YAN are not displayed on all pages of your resource, then the statistics of the Yandex counter will be underestimated. In this case, you will need to register and add your site to Yandex.Metrica (registration actually consists in receiving), and then receive and install the code on your site.

But we are more interested in the "Counter Code" tab, where, in fact, it will be possible to configure appearance and get the code. By the way, if you have a YAN context spinning, then it will be enough for you to get only the code for the informer, because your counter will be loaded automatically along with contextual ads.

In general, until 2009, Metrika was available only to those who played Direct on their website, which is why there is now such a strong relationship between these two services. , is the reverse side of the YAN advertising network - advertisers post ads in Yandex.Direct, and advertisers in Yandex. affiliate network they are hosted by webmasters. Well, if that's a rough approximation.

So, to activate the display of the informer, you will need to check the box of the same name. All settings for the appearance and functionality of the visible counter are hidden behind the "Configure informer" item.

As a result, an additional area will open where you can select one of the three types of Yandex counter and fine-tune its appearance and the information displayed in it:

The first option will display all three possible traffic indicators at once (from top to bottom): the number of page impressions of the studied site for the current day, the number of visits and the number unique visitors. In general, just everything you need.

The second option displays a color graph of attendance by day of the week and one of the three options described above. Which one will be displayed on the counter will depend on which box you check: Views, Visits or Visitors.

The third option will simply display one of the traffic indicators of your resource that you have chosen.

I think that it is not required to talk about how you can adjust the color scheme, because everything is clear anyway. You need to choose one of two display options and text color, as well as get more information when you click on the counter with the left mouse button (option " extended"- see the screenshot at the beginning of the article).

After you create your masterpiece, scroll down the window and click on the "Save" button. Now you need to copy the informer code and, if necessary, the counter code, which will be located in the lower area.

Note that the counter code will be wrapped in opening and closing tags of the form:

and informer - in tags:

Looking ahead a little, I’ll say that by installing the informer code on your site, you are unlikely to see anything on it, because you will still need to activate its display. This is done on the "Access" tab:

You need to check the box " Show informer data»:

At first I thought that it would take time, after which the figures themselves would appear in the informer. An, no. This tick is necessary and without it in any way.

How best to install the Yandex counter on the site

You can of course copy and paste them together. Everything will work, but it would still be better to insert the Metrica counter code into your website template before the closing /body tag, because in this case, the hung script will not slow down the loading of your resource pages.

Although lately we have been offered an asynchronous version by default, which does not affect the page load speed in any way:

But you can install the informer in any place convenient for you, in the same way as I described it in articles about:

I think that using the above materials, you can easily cope with this overwhelming task.

Yes, if you want visitors to your resource to be able to view the details of your counter, you will need to go to the "Access" tab in its settings and check the box "Public access to statistics", after which you will be provided with a link leading to a page with a statue open to everyone:

Good luck to you! See you soon on the blog pages site

You may be interested

OpenStat - hit counter and rating (formerly SpyLog), installation and work with statistics
HotLog - registration in the rating of sites and receiving a hit counter code
Rambler Top 100 - how to add your site to the rating (catalog) and get the hit counter code
openstat- free system collection and analysis of website traffic statistics (formerly SpyLog)
Mail.ru rating - registration in top.mail.ru, setting up, getting a counter code and the possibility of visits statistics
How to Set Hit Counters in WordPress and SMF - Paste Method to Improve Counting Accuracy
How to insert the hit counter code on the site under Joomla management via the Custom HTML code module or directly into the template
Yandex Metrica - login Personal Area, setting up and installing a counter on the site, working with statistics (goals, webvisor, etc.)
LiveInternet - installing the LI counter on the site - what to look at in the statistics of visits according to LiveInternet
Site attendance - how to check the statistics of visits to your resource or find out the counter readings of someone else's site

Show all content

In Soviet times, there was such an informative mini-series for children “I want to know everything”, where everything in the world was simply and clearly told (secrets of the universe, etc.).

And when I look at any site, I have the same thoughts “I want to know everything”. How many visitors were on the site, from what sources, how many of them left an application, for which keywords these people came.

WE ARE ALREADY MORE THAN 29,000 people.
TURN ON

Whatever you want

Tracking the cache in the address bar of the browser. A feature that can optimize the collection of statistics for AJAX sites.

asynchronous code. Since I'm not a programmer myself, I don't even know what it is. So I searched. Thanks to this checkbox, you activate the code asynchrony.

That is, when loading the site, all codes are loaded sequentially, and if something did not work, then the queue may not reach the loading of the metric. Thanks to this checkbox, Yandex.Metrica will always work.

For XML sites. A feature that allows you to optimize the collection of statistics for XML sites.

In one line. In fact, this one checkbox turns a huge code into some kind of text. If you are not well versed in programming, but you will insert the code on the site yourself, then feel free to click on this checkbox.

Prohibition of sending to the indexing of site pages. Don't want your site to be shown in Yandex Search? Just check this box and you can turn your dark deeds (just kidding).

Informer. I think you have often seen such a thing on the pages of various news sites.

informer

This is the same informer. Shows information (therefore informer) how many visitors there were on the site in the last 24 hours.

After clicking the checkbox, you will see it in the preview, and you can also customize it as you wish (make it beautiful graphically).

To be honest, if you have a one-page site where you sell goods or services, you do not need it.

But if you have informational portal and , which you constantly need to show advertisers, then yes, you need to check the box.

– Sending e-commerce data to Yandex.Metrica. Relevant if you have an online store. Check the box, set up goals for e-commerce and your applications, orders, purchases at a glance.

In theory. Because if you take it seriously, it's better to set up a system of end-to-end analytics. There will be an article on this topic, but later.

All that's left for you is to select the functions you need (if you don't want to bother - click all the checkboxes, it's not explosive) and click the "Save" button.

If you forgot to copy the code and you were redirected to another page, don't worry, you can always return to it.

So, all the settings have been made, the Metrica code is available, now you can take the code. This is how it will look normally


Code in its usual form

So, when you click on the “in one line” checkbox, then the same code is compressed in size

One line code

And this option to embed it on your site. I think if you speak the language html programming though not much, then installing the Yandex Metric counter for you will not be difficult for you.

The main thing is to insert it between the tags …. If this is difficult for you, then you can hire a freelancer on the Kwork website and pay 500 rubles for it.

As soon as it is installed, a green circle will light up (it used to be a checkmark).

Checking the installation

And if you need to change it or add something (for example), then all you need to edit is to press the gray pencil.

Briefly about the main

That's all, now you know how to install Yandex Metrika on the site. But just in case, briefly once again how to embed the Yandex Metrica code yourself:

  1. Create an account in Yandex;
  2. Go to the Metrica tool and click "Add counter";
  3. Add all the parameters you need (name, time zone, etc.);
  4. Save it (it is assigned a unique number);
  5. Set all the necessary technical settings;
  6. Save the counter;
  7. Paste it into your site.

But just in case, I'll warn you. If you decide to change the settings of the counter (forgot to connect the web browser, etc.), then you will have to insert it into the site again, so as I wrote above, check all the boxes, it will not be superfluous.

Life hack. If you are determined to attract clients from contextual advertising, then I recommend the Rush Analytics service. The speed of his work is amazing, he works online. And by this link you will be given 200 rubles for a test service 😉