Setting goals in Yandex. Metrica is a necessary step when launching an advertising campaign in Yandex. Direct. Setting goals accurately helps you track conversions and effectively set up retargeting. By ignoring an important point in the formation of an advertising campaign, the owners risk losing a huge part of potential customers and “draining” the entire advertising budget. Goal tracking can help you avoid failure and increase conversions.
What is the Yandex. Metrics counter and how to install it on the site
The Yandex. Metrics counter is a program code that is embedded in web pages. "Metrica" consists of two parts: a counter and a database. When users perform any actions on the pages of the site (login, clicks, transitions, etc.), the counter code is executed and transmits information about the web page and visitors' actions to Metrica.
Setting a goal in Yandex. Metrica begins with creating, configuring and installing a counter on the site.
- Open Yandex, register and log in to your account.
- Go to Metrica.
- Press the Add Counter button.
- Enter a friendly namecounter (for example, store name).
- Specify the address of the site to which it will be installed (or the full path to the page: my_syte.ru or my_site.ru/sale).
- Set the "Timeout" of the visit (the number of minutes of user inactivity on the site before the end of the session.
- For example, 30 minutes is indicated. If the user does nothing for a whole half hour, then the session will end and new actions will be recorded in another session.
- Accept the user agreement by checking the box and click "Create a counter".
Setting goals in Yandex. Metrica requires installing a counter code on the site. To do this:
- Press "Settings" (gear).
- Select the Counter Code tab.
- Check the boxes "Webvisor,…" and "Asynchronous code". A total of 8 meter code parameters are available. The first analyzes the actions of visitors, the second makes the code "lighter".
- Copy the counter code below and add it to the HTML code.
Tip: Set a counter before the closing /head tag on all pages to record all visits to the site. At this stage, the counter has been created, the initial settings have been made, the code has been installed on all pages of the site. Now the activity of visitors will be displayed in the Metrica service.
Setting goals in Yandex. Metrica
Each advertising campaign should lead the user to a certain result, which is called the goal.
There are two types:
- Conversion - track the effectiveness of an advertising campaign and conversion, help analyze the activity of the audience on the site.
- Retargeting - help you set up ads to be displayed to site visitors who have previously performed any actions on it.
Tuning goals are divided into:
- Simple - involves the execution of one step, the goal is achieved with one thing, for example, by clicking on a button.
- Compound - allow you to create a chain of steps that require sequential execution. It collects information about the execution of each step. Such an analysis will help to understand at what point visitors have difficulties.
Setting goals in Yandex. Metrica of a simple type consists of 5 main steps:
- Click the Add Target button.
- Give a descriptive name for the goal.
- Specify the condition type.
- Set the condition parameter.
- Click Add Target.
The created goal will be visible in the panel, which displays the number, name, description and ID.
Target: number of views
This goal will be reached when the visitor views the specified number of pages. To configure, add to the "View" condition the number of pages that the site guest should view. It is practically not used in online stores and one-pagers. However, it can be used to study user behavior.
Purpose: visiting pages
Achievement is a transition to a certain page (inside the site, from an ad unit, even downloading a file). Goal setting in Yandex. Metrica is carried out by adding a partial or full page URL and has several conditions:
- URL: Contains. This is part of the address. The goal was reached when following the link containing this part.
- URL: matches. You must specify the full address of the page that you need to visit in order for the goal to be achieved.
- URL: starts. Only the initial part of the link is entered, suitable for cases where a group of pages is tracked, for example my_site.ru/catalog.
- URL: regular expression. In this case, not the address is specified, but a regular expression containing the URL. For example, it is used for SEO analytics. Setting a goal in Yandex. Metrica with a regular expression requires careful study, and it is impossible to tell in one paragraph what it is and how to use it correctly.
Page visits are one of the most accurate goals that fire and only record a conversion when the visitor actually went to the page.
Target: JavaScript event
The goal here is to execute code, such as clicking a button, submitting a request via a form, and so on. The complexity of the setup lies in the fact that, in addition tocreating a goal in Metrica, you need to add an event code to the desired element on the site. In simple words, it looks like this: first, the element code fires, causing an event that the counter sends to Metrica.
Setting the "Event" goal in Yandex. Metrica is related to editing the web page code. For each element, a new target is created, in which a unique identifier is set. It is mentioned on the site once in the event code.
Setup is done in four steps:
- Add a new JavaScript event target.
- Enter a unique target ID.
- Save settings.
- Insert the event code into the HTML code of the page that is responsible for the desired element.
If the event code and identifier are inserted correctly, statistics will be collected after a while.
The most striking use case is button tracking, which captures Yandex. Metrics . Setting the Button Press goal follows the general principle.
- Create a JavaScript event target.
- Specify Click Target ID.
- Open the HTML code of the page where the button is located.
- Find the code that triggers the button.
- Add the event code there:
Composite target
When setting up a compound goal, you can create from 1 to 5 steps, which helps track a specific path of a site visitor. For an example, considerpassage from the catalog to the product card:
- Create a compound target.
- Enter a name for the first step ("Catalog").
- Specify the condition - URL: contains - and enter the link /Catalog.
- Click "Add Step" and enter a name for the next step ("Category").
- Specify URL condition.
- Repeat the steps for the third step "Product" and click the "Publish" button.
Setting goals in Yandex. Metrica for a one-pager
The main task of a landing page is to increase conversion and increase traffic. Here it is necessary to track any actions of visitors on the site: entering, browsing, clicking on buttons, sending an application, so it is important to correctly set goals in Yandex. Metrica. “Form submission” is the main goal for a one-pager, so it needs to be considered in detail.
- Create a target with condition type JavaScript event.
- Enter the unique identifier "ANKETA".
- Add an onsubmit event to the page code responsible for submitting the form:
Tracking "Yandex. Metrica" through Google Tag Manager
To use all available promotion and analytics tools, it is convenient when they are located in one place. Therefore, it is worth considering the question of how goals are set in Yandex. Metrica through GTM.
First of all, you need to add the counter code to GTM:
- Open GTM, go to "Tags" and clickthe Create button.
- Fill in a title at the top and select "Custom HTML Tag" at the bottom.
- In the HTML field, paste the copied Yandex. Metrica counter code.
- In "Activation Conditions" select "All Pages".
- Click the "Publish" button.
At this stage, setting up the Yandex. Metrica code using Google Tag Manager is complete. Now you need to set up the recording of events on the pages of the site and the transfer of data to Metrica.
For example, let's set up fixing the form submission:
- Create an additional tag, set the type to Custom HTML Tag.
- In the HTML field enter the code:
- In the activation conditions, specify the "Form" trigger.
- In the trigger settings, specify the conditions corresponding to the parameters on the site.
- Click the "Publish" button.
Using the capabilities of Google Tag Manager allows you to customize the goals of the "Event" without making changes to the source code of the pages. This is the safer way. It is useful when the source code of the site is not available.
Result
Setting goals in Yandex. Metrica requires an understanding of what goals the site is pursuing and what statistics are needed. It helps to track the effectiveness of advertising, it is easier to control the budget with it. In addition, the setting displays which campaigns should be invested in and which increase conversion. A visual demonstration of indicators in reports forms a clearpicture of user behavior. Goals in Metrica can be used to set up retargeting in Yandex. Direct. This will increase the conversion with already prepared visitors and increase brand awareness.