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, configure transmitting call tracker data to Yandex.Metrica. Then you can add calls to Yandex.Metrica reports and also use a special group of reports.
  1. How to create a multi-step goal
  2. Requirements and restrictions
  3. Example of user registration on a site

How to create a multi-step goal

  1. In the Yandex.Metrica interface, go to Settings → Goals.
  2. Click Add goal.
  3. In the Name box, enter a name for the goal to create.
  4. Set the option to Multi-step goal.
  5. Add the steps. Use criteria for tracking pageviews and goal IDs for transmitting JavaScript events.
  6. Click Add goal. The created goal is shown in the list of goals.
  7. Click Save. Yandex.Metrica begins collecting statistics within a few minutes after saving settings.


Criteria for tracking pageviews

ConditionDescription
“url: matches”Specify the full URL of the target page.
“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 completed only 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 http://example.com/abc/, the goal will be completed on the pages http://example.com/abc/1, http://example.com/abc/2, and http://example.com/abc/1/2/3.
“url: regular expression”Used for tracking URLs that match a custom pattern.

If you want the goal to be completed for pageviews with URLs containing the + 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. When you create a goal, you set its identifier. When a goal is completed, the reachGoal method is called, and the specified ID is passed to it.
  1. Use the reachGoal method on site pages.

    Examples:

    Clicking a button
    ...<form action="">    ...    <input type="button" onclick="yaCounterXXXXXX.reachGoal('TARGET_NAME'); return true;" value="Order" /></form>...

    where:

    • XXXXXX is the tag ID.
    • TARGET_NAME is the goal identifier.
    Filling in a form
    ...<form action="" method="get" onsubmit="yaCounterXXXXXX.reachGoal('TARGET_NAME', function () {alert('Data sent successfully');}, <The context accessible with the 'this' keyword in the callback function>); return true;">    ...</form>...

    where:

    • XXXXXX is the tag ID.
    • TARGET_NAME is the goal identifier.
  2. In the Yandex.Metrica interface, go to Settings → Goals.
  3. Set the option to Multi-step goal.
  4. For the condition, choose “goal ID event”.
  5. Specify the ID of the goal.

Requirements and restrictions

  • A goal may contain a maximum of five steps. Each step can have up to 10 conditions.
  • Don’t forget that each step must require completing the previous step. For example, if a user can skip the first step and immediately perform the second step, the goal is not considered completed.
  • The steps don't have to be completed directly one after another. On their way to the goal, users might visit different pages of the site and perform other actions not related to the goals of the steps.
  • The steps must be completed during a single session.
  • Conditions in steps are combined with the OR operator, so the goal is considered completed if at least one of the set conditions is met.
  • A maximum of 200 goals can be set for each tag.
  • The service registers a user completing the same goal on the same tag no more than once per second.
  • During a single user session, the service can register up to 400 completions of all the goals 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, the information collected for it will not be available in reports.

Example of user registration on a site

The tag owner's site has a “Sign up” 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.