Multi-step goal

This type of goal lets you set a sequence of steps that the user completes to reach a goal. These steps can be pageviews or JavaScript events.

Tip

Some users might complete the goal somewhere other than on the site, such as by making a phone call. To count these users, set up sending call tracker data to Yandex Metrica. Then you can add calls to Yandex Metrica reports and also use a special group of reports.

How to create a multi-step goal

  1. In Yandex Metrica, go to the Goals page in the left menu.
  2. Click Add goal.
  3. In the Name field, enter a name for the goal to create.
  4. Select the Multi-step goal type.
  5. Add the steps. Use criteria for tracking pageviews and goal IDs for transmitting JavaScript events.
  6. Click Add goal. The created goal will appear in the list of goals. Yandex.Metrica will start collecting statistics on it within a few minutes.
  7. Check whether the goal is working correctly.

Criteria for tracking pageviews

Criterion

Description

url: matches

If you select the full address in the settings, the tag will track sessions where the page address is identical, including the protocol (http:// or https://), domain, and all parameters after the ? sign (if any), excluding the UTM tags.

If you select the path to the page in the settings, the tag will track sessions with matches between the domain name of the tag and the domain name on which the specified page is located. Note that the page's path that comes after the slash / must exactly match the path specified in the tag settings.

Example

URL matches: /metrika, the URLs specify example.com and mysite.com domains. The goal will trigger for the URL (since the path matches and the domains are in the settings):

  • http://example.com/metrika.
  • http://mysite.com/metrika.
  • https://example.com/metrika.
  • https://mysite.com/metrika.
  • https://example.com/metrika/?utm_source=123.

The goal will not trigger for the URL:

  • http://test.ru/metrika (the path matches, but the address is not specified in the tag settings).
  • http://example.com/metrika/test (the path does not match).
  • https://example.com/?test=123 (the URL contains parameters).
  • http://example.com (the path does not match).

In both cases, if a user lands on a page where the tag is installed, and the page URL completely matches the one specified in the settings, the tag will count this session.

url: contains

Specify part of a URL. Use this option if there are multiple target pages and they can be combined with a single condition. Specify as much of the URL as possible so the goal is only completed on the desired pages.

Example

If the condition is /abc, the goal will be completed on the pages example.com/abc-1, example.com/abc/2, and example.com/abcd.

url: begins with...

Only the first part of the URL is specified. Use this condition if you want to track views in subdirectories.

Example

If the condition is https://example.com/abc/, the goal will be completed on the pages https://example.com/abc/1, https://example.com/abc/2, and https://example.com/abc/1/2/3.

url: regular expression

Used for tracking URLs that match a custom pattern

When handling the condition, such symbols as ?, #, &, and the dot (.) are removed from the end of the URL. For example, the URLs http://example.com/?, http://example.com/#, and http://example.com/?var=1& will be compared to http://example.com/, http://example.com/, and http://example.com/?var=1, respectively. To add these symbols, except the dot, to the URL, use the url: regular expression condition.

If you want the goal to be completed for pageviews with URLs containing the plus sign, put %2B in the template in place of the + character.

Example

See the examples for using “url:” criteria.

“Event: goal ID” as a condition in a multi-step goal

An event in a multi-step goal is an event transmitted to Yandex Metrica via JavaScript. Creating a goal includes specifying its identifier. When a goal is completed, the reachGoal method is called, and the specified ID is passed to it.

  1. In Yandex Metrica, go to the Goals page in the left menu.

  2. Select the Multi-step goal type.

  3. Choose the “goal ID event” condition.

  4. Specify the ID of the goal. Below the identifier field, the Goal code for site line will appear. Copy the code. You will need it to configure the reachGoal method on your site.

  5. Use the reachGoal method on site pages.

    Examples
    ...
    <form action="">
    ...
    <input type="button" onclick="ym(XXXXXX, 'reachGoal', 'TARGET_NAME'); return true;" value="Order" />
    </form>
    ...
    
    ...
    <form action="" method="get" onsubmit="ym(XXXXXX, 'reachGoal', 'TARGET_NAME'); return true;">
    ...
    </form>
    ...
    

If you use a regular expression as an identifier, this regular expression must contain only the identifier value (without any domain or website protocol).

Example

If you want to track clicking a particular button with the ID that contains button or buy, you can specify the following condition: button|buy.

Requirements and restrictions

  • A goal may contain a maximum of five steps. Up to 10 conditions can be added to a single step.

  • Select a chain of steps so that each subsequent step can’t be taken unless the previous one is performed. For example, if a user can skip the first step and immediately perform the second step, the goal is not considered completed.

  • The user must follow the sequence of actions defined in your goal settings. However, they can still complete actions that are not linked to any goals, such as viewing other site pages. This won’t break the sequence required to achieve your goal.

  • The steps must be completed during a single session.

  • The conditions described in these steps are combined using the logical OR operator. A goal is considered completed if at least one of its conditions is met.

  • You can't use Page depth goals.

  • A maximum of 200 goals can be set for each tag.

  • The service registers a user reaching the same goal on the same counter no more than once per second.

  • During a single user session, the service can register up to 1000 offline conversions and 400 online conversions created for the tag.

  • If you edit the tag or a goal, all the previously collected information does not change.

  • If you delete a goal, information collected for it is no longer available in reports.

Example of user registration on a site

The tag owner’s site has a “Register” link (http://example.com/registration/). When a user clicks the link, it opens a form to fill in with the “Submit” button.

For the first step:

  1. Set the type of condition to “url: contains”.
  2. Specify the condition registration.

For the second step, use a JavaScript event:

  1. In the form on the site, use the reachGoal method. It is called when the goal is completed (in this case, when the user clicks the “Submit” button).
  2. In the Yandex Metrica interface, choose the “event: ID” condition and specify the goal ID set in the reachGoal method.

Learn more

Chat with us

Write an email

Goals in Yandex Metrica work the same way for any sources. Perhaps there aren’t any users who have completed the goal from this source yet.

The recommendations did not help

Please note: Our support team will never initiate a call to you. Do not follow any instructions of people who call you and introduce themselves as the Yandex Metrica support team.

This might happen for the following reasons:

  • The goal condition in Yandex Metrica doesn't cover all the possibilities. For example, the goal is set as going to the order confirmation page, but the site also allows instant checkout without visiting this page.
  • The site user has a browser plugin that blocks the Yandex Metrica tag, so this user isn’t counted.
  • The user has an antivirus system with strict privacy settings.
  • The user has a slow internet connection, so the Yandex Metrica tag didn’t load on the target page.
The recommendations did not help

Please note: Our support team will never initiate a call to you. Do not follow any instructions of people who call you and introduce themselves as the Yandex Metrica support team.