Conversion
Use the Conversion goal to track both online and offline events.
This type of goal lets you track various events on your site — from simple actions (button clicks, form submissions) to complex programmed scenarios with multiple conditions. It also supports transmitting data about offline conversions that occurred outside your site (for example, order payments). With this goal type, you can track virtually any user actions.
To pass data about online events, use the reachGoal method. For offline events, follow the instructions for transmitting offline data.
Tip
If you're not comfortable with coding, use:
- The Form submission goal.
- The Click on button goal.
- Pre-built integrations with Yandex Metrica.
- Other goals from the Conversion actions and Engagement sections in the goal builder.
How to create a target event
Note
Goal identifiers for matches and contains conditions mustn't contain the following characters: /, \, &, #, ?, =, and ". If you need to add to an ID the + sign, replace it with %2B.
-
In Yandex Metrica, use the left menu to go to the Goals page and click Add goal.
-
Select the Conversion goal type.
-
In the Name field, enter a goal name.
-
Specify a condition and goal identifier.
-
Configure data transmission to Yandex Metrica based on the data transfer method (online or offline).
OnlineOfflineTo transmit a target event from your site to Yandex Metrica, add code with the reachGoal method to the page.
Examples:
Clicking a button
<form action=""> ... <input type="button" onclick="ym(XXXXXXXX, 'reachGoal', 'TARGET_NAME'); return true;" value="Order" /> </form>XXXXXXXX— The ID of your tag.TARGET_NAME— Goal ID.
Filling in a form
... <form action="" method="get" onsubmit="ym(XXXXXXXX, 'reachGoal', 'TARGET_NAME'); return true;"> ... </form> ...XXXXXXXX— The ID of your tag.TARGET_NAME— Goal ID.
Sending revenue by goal
... <form action=""> ... <input type="button" onclick="ym(XXXXXXXX, 'reachGoal', 'TARGET_NAME', {order_price: '1000.35', currency: 'RUB'}); return true;" value="Order"/> </form> ...XXXXXXXX— The ID of your tag.TARGET_NAME— Goal ID.order_price— Revenue by goal. You can specify revenue in a currency or in conventional units.currency— Currency of the revenue by goal. Yandex Metrica understands three-letter ISO 4217 currency codes.
To send an offline target event, use:
- The Yandex Metrica web interface.
- The Yandex Metrica API.
- The Albato automation service (setup instructions).
To learn more, see Transmitting and processing data.
-
Click Add goal. The new goal will appear in the list. Yandex Metrica will start collecting statistics within a few minutes.
-
Check whether the goal works correctly.

Conditions for tracking a goal
There are several types of conditions available when creating a goal. Conditions are combined with the OR operator, so the goal is considered completed if at least one of the set conditions is met.
|
Criterion |
Description |
|
matches |
A full goal identifier is specified. |
|
contains |
A part of the ID is specified. Use this option if there are multiple goals and they can be combined with a single condition. Specify as much of the ID as possible so that only the desired goals are achieved. ExampleIf the condition is |
|
regular expression |
This is used for tracking goal identifiers that match a custom template. When setting up the condition, the regular expression must only contain the identifier value (without any domain or website protocol). ExampleIf you want to track clicking a particular button with the ID that contains |
Restrictions
-
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.
Learn more
|
Useful links |
Online training |