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.
How to create a multi-step goal
- The goals created for tracking offline conversions.
- The “Call” goal created when transmitting data via a call tracker.
- The goals created on an organization's tag in Yandex Business.
- Goals of the Click on email, Click on phone number, Form submission, Open messenger, File downloads, and Site search types.
- In Yandex Metrica, go to the Goals page in the left menu.
- Click Add goal.
- In the Name field, enter a name for the goal to create.
- Select the Multi-step goal type.
- Add the steps. Use criteria for tracking pageviews and goal IDs for transmitting JavaScript events.
- 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.
- Check whether the goal is working correctly.
Criteria for tracking pageviews
Condition | Description |
---|---|
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 set to 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. |
Condition | Description |
---|---|
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 set to 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, symbols such as ?, #, &, and dots (.) are removed from the end of the URL. For example, for the URLs http://example.com/?, http://example.com/#, and http://example.com/?var=1&, the comparison will be made with http://example.com/, http://example.com/, http://example.com/?var=1, respectively. To add these symbols, except a 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
- In Yandex Metrica, go to the Goals page in the left menu.
- Select the Multi-step goal type.
- Choose the “goal ID event” condition.
- Specify the goal ID. The Goal code for the site appears under the ID field. Copy the code. You'll need it to configure the reachGoal method on your site.
Use the reachGoal method on site pages.
Examples:
... <form action=""> ... <input type="button" onclick="ym(XXXXXX, 'reachGoal', 'TARGET_NAME'); return true;" value="Заказать" /> </form> ...
... <form action="" method="get" onsubmit="ym(XXXXXX, 'reachGoal', 'TARGET_NAME'); return true;"> ... </form> ...
where
ym(XXXXXX, 'reachGoal', 'TARGET_NAME')
is the goal code for the site from the goal settings.
Requirements and restrictions
- A goal may contain a maximum of five steps. Each step can have up to 10 conditions.
- 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.
- 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 that completes 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 a tag.
- If you edit a tag or goal, previously collected information doesn't 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 “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:
- Set the type of condition to “url: contains”.
- Specify the condition registration.