Revenue by goal
When a goal is completed, Yandex Metrica can count revenue for that goal. This helps you measure cost-efficiency for the goal. You can set the cost of the item or another value as revenue by goal.
You can set revenue:
- In Yandex Metrica, for any goal or step of a Multi-step goal (in the currency specified in the tag settings).
- In the site code, for JavaScript event goal conversions, offline conversions, calls, or events passed using the JavaScript API (in an ISO 4217 currency).
If you use both methods, the revenue passed when the goal is converted takes priority. Yandex Metrica saves the revenue when it registers goal conversion.
Yandex Metrica counts revenue for the conversions that occurred after you specified the revenue. If you edit the value, the revenue is counted for the goals converted after the edits.
To track the revenue, add to the report a goal or step of a Multi-step goal and the Revenue target metric. For more information, see How to create a report on a goal. The total revenue for a multi-step goal is not displayed.
Note
Revenue by goal is not taken into account when setting up key goals in Yandex Direct.
How to specify revenue in Yandex Metrica for any goal
- Go to the Goals page in the left menu.
- Edit a previously created goal (click
) or add a new goal.
- In the Revenue field, specify the value.
How to set revenue in any currency for the “JavaScript event” goal
Example of setting up revenue for a JavaScript event form submission goal:
...
<form action="">
...
<input type="button" onclick="ym(XXXXXX, 'reachGoal', 'TARGET_NAME', {order_price: '1000.35', currency: 'RUB'}); return true;" value="Order"/>
</form>
...
XXXXXX
— Your tag number.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 recognizes a three-letter ISO 4217 currency code.
How to send revenue data using an attribute selector
To transfer revenue as order_price
from all pages of the site where it is set by an attribute selector (for example, class
or id
), pass the selector name along with the revenue data to Yandex Metrica.
-
Find the fragment in your site code where a selector of this type is set. Example:
<div class="ORDER">Order amount: <div class="PRICE">110</div> RUB</div>
-
Add the selector name to the code of the element that will send the revenue by goal to Yandex Metrica. Example:
<input type="button" onclick="ym(XXXXXX, 'reachGoal', 'BUY', {order_price: document.querySelector('.PRICE')?.textContent}); return true;" value="Order" />
More details about the reachGoal method.
Learn more
Useful links |
Online training |
A numerical value calculated for the goal specified in the report. This amount can be the total or average. For example, conversions are calculated as the total of all values, and conversions per user is calculated as the average value.