Consistently setting goals in Yandex Metrics. Guide to setting up goals in Metrica: let's figure it out together Set IDs of target actions for metrics from Yandex

Setting up goals in Metrica is needed to track specific actions of site visitors and evaluate the effectiveness of advertising campaigns in Yandex.Direct. After collecting data for a certain period, you will find out from which ads visitors most often perform the target action.

After analyzing the statistics, you can make the necessary adjustments to your advertising campaign. As a result, the costs of promoting goods/services will decrease and profits will increase.

What goals are important to set?

First of all, statistics require information about the audience’s actions with the main elements of the site. They are conventionally divided into three groups.

  • Sales.
    • Click on the order button.
    • Adding an item to the cart.
    • Go to cart.
    • Filling out confirmation and payment forms.
    • Final purchase processing.
    • Product comparison.
    • Download price list.
    • Order a call back.
  • Information about the company. This category of actions includes user transitions to the pages “Contacts”, “About the company”, “Terms of payment and delivery”, “Licenses”, “Certificates”, etc.
  • Interest (the goals of this group are especially important for information resources). This includes: depth of page viewing, transitions to articles on similar topics, time spent by the user on the site, etc.
  • Types of goals in Yandex.Metrica

    Goals that can be flexibly configured in Yandex.Metrica are classified into 4 types.

    • Event (JavaScript). The goal is focused on tracking specific user actions.
    • Visiting pages. Visits to important pages on the site are controlled.
    • Number of views. Configured to determine interest.
    • Composite goal. Represents a chain of steps that may include events and page visits.
    What is it for

    Consider a standard online store site where users can fill a cart and buy selected products. In this case, you need to set up a composite goal - a sales funnel; usually in Metrica it includes the following sequence of actions:

    • click on the add item to cart button;
    • go to cart;
    • finalize your order.

    After setting up a goal in Yandex.Metrica, detailed information on each stage becomes available.



    This data helps to find out how many potential customers abandon purchases and at what point. In most cases, if users don't click through to their cart, they're unhappy with the prices. Refusal to confirm a purchase may indicate the lack of a convenient payment method or too many fields in the form that a potential customer must fill out.

    Instructions for setting goals in Yandex.Metrica Number of views

    This is the simplest, but very useful goal. With its help, you can obtain the following information:

    • how well the site structure is developed;
    • are there any problems with navigation;
    • whether the linking was done correctly;
    • is it convenient to use;
    • how useful and high-quality content is placed on the pages;
    • Do visitors to the web resource want to study the information presented in depth?

    Setting up this goal in Metrica is especially relevant for owners of websites of three categories.

    • "Information specialists". Here it is important to know whether visitors go to articles with similar topics.
    • Educational sites. Ease of navigation and quality of training materials become important.
    • Commercial sites with thematic blogs and articles.
  • Go to the "Goals" section.
  • Select the “Number of Views” type and come up with a name.
  • Specify the required number of views
  • Click the "Add Target" button.
  • Click the Save button at the bottom of the Goals page.

  • As you can see, everything is simple.

    Visiting pages

    A more difficult to set up goal that allows you to track user visits to certain pages of the site. Most often it is installed to obtain answers to the following questions:

    • Is the linking done correctly?
    • Are links to important pages in the right places?
    • Are users getting to the point of taking targeted actions?

    Setting up such a goal in Yandex.Metrica is especially relevant for owners of trading platforms and service sites. It helps determine whether customers go to cart, complete checkouts, what products/services they are most interested in, whether they are researching information about payment/delivery methods, etc.

    The setup goes like this.

  • Select the "Settings" menu item.
  • Go to the "Goals" section.
  • Click the "Add Target" button.
  • Specify the necessary condition (we will discuss them below).
  • Paste the link into the "Value" field.
  • Click the "Add Target" button.

  • Types of conditions:

    • "Url: begins." Used to track groups of pages with the same start addresses. An ideal example is product cards for a specific catalog section.
    • "Url: matches." This condition is specified to track visits to specific pages.
    • "Url: contains." Allows you to evaluate traffic to dynamic pages. The “tails” of addresses are usually indicated here.
    • "Url: regular expressions." Instead of links, expressions from metacharacters are indicated. All the details .

    Note! You can set up to 10 conditions for one goal. Completing any of them is considered achieving the goal.

    Events (JavaScript)

    This goal helps track user actions with all elements placed on the site: buttons, forms, checklists, etc. It is widely used in analyzing the performance of trading platforms and sites with services.

    Setting up this goal allows you to:

    • calculate the number of clicks on the “Buy”, “Add to cart”, “Check out” buttons, etc.;
    • find out which product characteristics are of most interest to users (if the selection of parameters is implemented using a checklist);
    • determine whether users are interested in information hidden under spoilers, etc.

    As a result, you will receive information about which interactive elements on the site work and which do not.

    To set up such a goal in Yandex.Metrica, follow the following procedure.

    Stage 1. Create a goal
  • Select the "Settings" menu item.
  • Go to the "Goals" section.
  • Click the "Add Target" button.
  • Note its type and come up with a name.
  • Specify the target ID.
  • Click the "Add Target" button.

  • Note! Identifiers should not partially or completely coincide with site page addresses. You can only use Latin characters and numbers, as well as underscores.

    Stage 2. Adding an identifier to the page’s html code

    In order for Metrica to start recording goal achievement, you need to convert the html code of the element on the page. You will find codes for buttons, link forms and other elements.

    The general principle looks like this:

  • Select the appropriate standard code (on the page via the link above) and change it to suit you (you need to enter the counter number and the name of the target identifier in “Metrica”).
  • Open the landing page of the site and look for the desired element.
  • Right-click on it and select “View code” in the menu that appears.
  • Copy the line highlighted in the console.
  • Go to the root directory of the site via FTP.
  • Find the file with the source code of the page and open it.
  • Look for the copied line in the code (the search menu opens when you press Ctrl+f).
  • Add to it (before the closing tag) the code obtained in step 1.
  • Save the file.
  • Note! If you are not sure about something, make a backup copy of the file.

    Composite Goals

    Composite goals are best for measuring the performance of sales funnels. They represent chains of actions that the user must perform.

    When setting up composite goals in Metrica and analyzing data, consider the following important features:

    • maximum number of steps - 5;
    • to achieve the goal, the steps must be completed in a given sequence;
    • there may be other actions in between;
    • If the user is interrupted during the execution of actions for at least a period set as a timeout, achieving the goal is not counted.

    To set up compound goals in Yandex.Metrica, proceed as follows:

  • Select the "Settings" menu item.
  • Go to the "Goals" section.
  • Click the "Add Target" button.
  • Note its type and come up with a name.
  • Add the required number of steps, name them and indicate all conditions.
  • Click the "Add Target" button.

  • We figured out the settings. Now we’ll tell you how to check the functionality of the goals.

    Checking goals

    There are two ways to make sure that everything is working correctly.

    Method 1. Manually checking goals in Metrica
  • 20 minutes after setting the goal, open “Metrica” and select the “Settings” menu item.
  • Go to the "Filters" section.
  • Disable the "Do not track my activities" option.
  • Complete the target action.
  • After a while, check whether the counter recorded the event in the Conversions report.
  • Method 2: Checking targets using the browser console
  • Add “?_ym_debug=1” to the landing page address in your browser.
  • Press Ctrl+Shift+J - the console will open.
  • Complete the target action.
  • If everything is in order, a message will appear in the console indicating that the data has been transferred to the counter.


    The absence of a message indicates that the goal is not working.

    Why goals may not work

    There are three main reasons that apply to all types of goals.

  • The counter on the page is not set or set incorrectly.
  • The work of Metrica is blocked by any extensions (for example, Adblock Plus) or other scripts.
  • The visitor left the page before the counter loaded.
  • Events (JavaScript)

    Events typically don't work in the following cases:

    • The identifiers (on the landing page and in the counter settings) do not match.
    • The reachGoal method call code is missing.
    • The reachGoal method is added correctly, but the event that calls it does not occur for some reason.
    • The reachGoal method fires before the counter is loaded.
    Visiting pages
    • The page address is not specified in the goal settings.
    • The link was entered incorrectly.
    • The site page addresses contain the # symbol.
    • An incorrect condition was selected in the target settings.
    • The page has a cyclic redirect installed.
    Composite Goals
    • The conditions of one or more steps cannot be met for some reason.
    • The last steps can be completed without completing the first.

    As you can see, there are many reasons for the failure of established goals. To troubleshoot problems, first check that all settings are correct. If everything is fine, dig deeper or contact the professionals.

    One of the processes that turns out to be difficult for a beginner is setting up goals in Yandex Metrica. But the future collection of statistics and its processing to improve the result depends on its correct installation.

    What are goals in Yandex Metrica?

    A goal in Yandex Metrica is the actions of visitors that are beneficial to the site owner or important for collecting statistical data. For example, following a link, submitting an application form, etc. The goal is considered achieved if the user has fulfilled the specified condition. Conventionally, goals are divided according to several criteria.

    Goals by difficulty level

    Goals in Yandex Metrica are divided into simple or compound.

    A simple goal is set by one condition. For example:

    • Number of views - viewing the initially specified number of pages on the site. If you specified a parameter of three in the settings, the goal will be considered achieved when the user visits three pages during one visit.
    • Page visits - viewing specific pages of the site. This condition allows you to track the number of visits to a specified page, such as order form submissions.
    • JavaScript event - in this case, the event that you want to track is written manually. Setting up JavaScript events makes it possible to find out the type of user interaction with the site, for example, clicking a button, following URLs, sending an order to the cart, payment, etc. It is actively used for landing pages.

    A composite goal includes several sequential steps that the visitor must take. Each action has one condition. This approach allows you to figure out at what stage site guests encounter difficulties.

    Goals by purpose
    • Conversion goal - used to view statistics (target visits, percentage and number of conversions, etc.)
    • Retargeting goal - used to set up impressions according to the conditions for selecting the target audience through the Yandex interface. Direct.

    The more accurately you plan to customize your advertising, the more retargeting goals you need to create.

    Retargeting is a mechanism by which online advertising follows those users who visited a site and showed interest in it (stayed for more than 60 seconds, followed a link, etc.). Since such guests are already familiar with the site’s products and services, they are more likely to place an order by completing the desired goal for the owner on the payment button for the goods.

    Setting up goals in Yandex Metrica (step-by-step instructions) Creating a goal

    To create a goal in Yandex Metrica:


    The metric starts collecting statistics a few minutes after adding a goal. The results can be seen in the conversion report.

    Setting goals
    • Name the goal in a way that makes sense to you (this will help you understand the reports faster).
    • Click the button Add a goal.
    • Specify the number of pages you want the user to visit.

    2. Visiting pages:

    • Give the goal a clear name, such as “View product detail page.”
    • Set the appropriate condition:

    url: contains - this condition is selected when you are interested in traffic statistics for several pages, for example, a filter in a site directory. The condition must include the part that is common to all URLs.

    url: matches - this condition is used to analyze the statistics of visits to a specific page. In the target field, the page address is entered in full.

    url: starts with - is intended to control traffic to pages that have an identical beginning of the URL (for example, a subcategory of products in a catalog). Only the beginning of the link is entered in the target field.

    url: regular expressions - used to set flexible parameters for analyzing user actions.

    • Click the button Add a goal.

    Using this goal, you can evaluate the dynamics of traffic to a given page of the site and understand how effectively linking works. You can also track the number of orders, tracking visits to the “thankyou” page.

    Target Visiting the page most relevant for online stores and service sites. Their owners can find out whether users visit the product description or payment page, whether they add an order to the cart, whether they are interested in delivery options, etc.

    3. JavaScript event

    In this case, in addition to actions in Yandex Metrica, you will need to install a tracking identifier on the site. To do this you need access to the site code.

    • Give the goal a name that is simple and understandable to you, for example, clicking on the “Request a call” button.
    • Fill in the field Target ID. It should not match the content of the URL (even partially).
    • Click the button Add a goal.


    To bind JavaScript to the appropriate event on the site:

    Code for tracking form completion:

    onsubmit=

    Code for tracking clicks on various elements:

    onclick= "yaCounterХХХХХХХХ.reachGoal("GOAL"); return true;"

    where “ХХХХХХХХ” is the Yandex Metrica counter number, “GOAL” is the tracking identifier.

    4. Composite goal

    Setting it up is not difficult if you have mastered the principles of setting simple goals.


    Target check

    To check that the target is installed and configured correctly, do the following:


    If this does not happen, then Metrica does not read the completed goal for one of the following reasons.

    Why don't goals work?

    There are 4 main reasons:

    1. The counter on the landing page is not installed or installed incorrectly. To place a counter on your website:

    • Log in to Yandex Metrica.
    • Click the Add counter button.
    • In the Counter name field, enter its name.
    • In the Site Address field, specify the main domain of your resource, excluding the scheme/protocol prefix (http://, https://). You can specify the site path (path in the URL structure) in this field, discarding part of the address to a specific file or page fragment (the “#” symbol). If you leave this part, an error will appear in the input field, and the request parameters passed to the URL (the part of the address after the “?” character) will not be taken into account.
    • To use one counter to track activities from multiple sites, fill out the field Additional website addresses.
    • To ensure reliable statistics, you can also enable the option Accept data only from specified website addresses.
    • To take into account subdomains of the main and additional sites when filtering, activate the option Including subdomains.
    • Select your time zone.
    • If desired, change the visit timeout in minutes - this is the time the visitor spends passively on the site. The default is 30 minutes. It can be raised up to 360. Each step is 30 minutes.
    • Click the button Create counter(located at the bottom of the page and confirms all actions performed).
    • The counter code appears in a new window.
    • Near the option Webvisor, scroll map, form analytics check the box.
    • Copy the code.
    • Click on the button Save.

    For the counter to work, it must be added to all pages of the site between tags or closer to the top of the page.

    Statistics collection begins a few minutes after the counter is correctly configured and added to the site.

    You can check the activity of the counter in the My counters section, in the status of checking the correctness of the code installation.

    2. The counter is blocked by other scripts. The fact of blocking is displayed in the browser console. To correct errors, contact the employee responsible for technical support of the site.

    3. The counter is blocked by the Adblock Plus extension. It is used for browsers and other software. Blocks the loading and display of advertising on website pages and in search results.

    4. The guest left the site page before the counter loaded.

    Notes
    • A maximum of 200 targets can be set for one counter.
    • A visitor's achievement of the same goal on one counter is recorded no more than once per second.
    • If the counter has been edited, all previous data is not recalculated.
    • When you delete a target, information about it is not displayed in reports.
    • If the URL of the given page contains the + symbol, use "%2B" in the template instead.
    • Installation and configuration of Yandex Metrics is also possible through gtm (Google Tag Manager).
    • Remember that the audience for retargeting begins to appear only after setting up goals. Therefore, complete the setup even before you launch paid traffic to the site.

    Setting goals in Yandex Metrica provides the site owner with valuable information to increase conversion: the level of user interest in a product or educational information, ease of navigation, etc.

    Using this information, the resource owner can make informed conclusions about the effectiveness of the advertising strategy, the necessary settings on the site, or changes to the assortment of the online store.

    The first thing a marketer checks at the beginning of the working day is web analytics systems. How many users came in a day, where they came from, what target actions they performed and whether they took place at all. Goals are responsible for the last point.

    Technically, setting up goals is not difficult (we will show this below), but choosing which goals to set up on the site is a problem.

    There are 4 types of goals in Yandex.Metrica:

  • Number of page views.
  • Visiting pages.
  • JavaScript event.
  • Composite goal.
  • Each type can be conversion or retargeting.

    In this article we will analyze all the options for goals in Yandex.Metrica, how to choose the right ones so as not to spoil the analytics, how to set them up and what conclusions can be drawn based on them.

    Conversion and retargeting goals in Metrica - what's the difference?

    To make a goal retargeting, check the appropriate checkbox in the goal settings.


    You can check this box later if you missed it.

    How to set up a Views goal

    Useful for blogs, media, entertainment and educational portals, and anywhere where you need to evaluate engagement.

    On corporate websites where there is a large catalog of products, this goal can be used as a micro-conversion - “Viewed X pages” will indicate the user’s interest. You can “catch up” with it using retargeting in Yandex.Direct.

    Nuances:

    Metrica counts not only a transition, but also a page update as a “view.” If the user, while on the page, refreshes it, this will count as 2 views. In our experience, many such “views” end up in the statistics. Therefore, you should not count viewing 2-3 pages as engagement. For this purpose, choose to view at least 4-5 pages.

    How to set up "Page Visits"

    You can set multiple conditions. Then the OR operator will operate between them (visited either this page or this one).

    Let's say we need to track how many people made a payment on the site. To do this, we will record the transition to the Thank you page - the page that the client gets to only after payment. In this case, we have 4 conditions:


    url: contains: The goal will be achieved if the user visits any page that has the word done in the url. For our task, the tactics are unsuccessful - what if more pages with such a word appear?

    url: matches: the goal will be achieved if the page address completely matches the one specified in the goal. This task is suitable if there is no dynamic parameter on the page (for example, order number or user id in the system).

    url: starts with : The goal will be achieved if the user visits any page starting with the given part of the url. The beginning from our example is also not suitable - it can be not only on the page after the order, but also on the checkout page.

    Let's go back to the example. Let's say that after payment the order number is inserted into the url: order_id=1234. To record transitions to each page, we add the parameter - /d(4) instead of numbers. /d means that there is a number in this place, and (4) that it consists of four digits.

    Nuances:

    A popular mistake is to set up the goal “Went to Contact page”. Passed does not mean called or wrote. Such a goal can speak about conversion only in cases where the contacts are no longer written on any other page.

    How to set up a JavaScript event

    Using this goal, you can record a click on a button, submission of a completed form, and other actions directly related to the click.

    Setting up a button click target

    Find out how many users clicked on the “Order” button.

    • Enter the goal identifier in Metrica.

      Write it in Latin letters and so that you understand what action was performed. For example, for the “Order” button you can specify the zakazat identifier. Important: the identifier and text in the page url must not match.

    • Add a parameter to an element in the site code. The button can be easily found using the word button.

    The initial code might look like this:

    Related publications