Goals on Turbo pages created in Yandex.Webmaster
Goals for an informational site
To track the users' interaction with Turbo page elements, use a “JavaScript event” goal.
- Add the turbo:goal element to an RSS feed:
... <turbo:goal type="yandex" turbo-goal-id="goal-link" name="TARGET" id="12345" /> <turbo:content> <![CDATA[ ... ]]> </turbo:content>
where- name is the goal ID.
- id is the tag number.
- turbo-goal-id is the ID to assign to the Turbo page content
- Add the ID to the content you want to track statistics for as the data-goals attribute value. You can specify multiple comma-separated values, i.e., you can link multiple goals to a single element on a Turbo page.
<turbo:content> <![|||UNTRANSLATED_CONTENT_START|||CDATA[ <p><a href="http://example.com/" data-goals="goal-link,goal-link2">Текст</a></p> ]]> </turbo:content>|||UNTRANSLATED_CONTENT_END|||
- Add the turbo:goal element to an RSS feed:
... <turbo:goal type="yandex" turbo-goal-id="goal-link" name="TARGET" id="12345" /> <turbo:content> <![CDATA[ ... ]]> </turbo:content>
where- name is the goal ID.
- id is the tag number.
- turbo-goal-id is the ID to assign to the Turbo page content
- Add the ID to the content you want to track statistics for as the data-goals attribute value. You can specify multiple comma-separated values, i.e., you can link multiple goals to a single element on a Turbo page.
<turbo:content> <![|||UNTRANSLATED_CONTENT_START|||CDATA[ <p><a href="http://example.com/" data-goals="goal-link,goal-link2">Текст</a></p> ]]> </turbo:content>|||UNTRANSLATED_CONTENT_END|||
- In Yandex.Metrica, use the left menu to go to the Goals page and click Add goal.
- In the Name field, enter a name for the goal to create.
- Choose the JavaScript event goal type.
- 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.
- 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.
Data will start being transmitted to Yandex.Metrica after the robot checks the RSS feed and finds out about the changes.
The created goal can be used in most Yandex.Metrica reports. You can also track conversions by goal using the Conversions report.
Goals for your online store
If your online store uses Turbo pages that are generated from a YML file, you can track the following metrics:
User actions
To track user actions in Yandex.Metrica, you need to use the “JavaScript event” goal type and IDs. This enables you to track:
Action | ID |
---|---|
Cart actions | |
Clicks on the Add to cart button | add-to-cart |
Go to cart button clicks (appears instead of the Add to cart button) | open-cart-from-product |
Clicks on the Go to cart button displayed in the page header | open-cart-from-header |
Opening the order form in the basket | open-check-out-form-from-cart |
Sending information via the order form from the basket | send-check-out-form-from-cart |
Each instance the “Thank you for your order” message is displayed in the basket | check-out-form-success-from-cart |
1-click purchases | |
Each instance a user opens the Buy in 1 click form | open-check-out-form |
Each instance information is sent via the Buy in 1 click form | send-check-out-form |
Each instance the “Thank you for your order” message is displayed | check-out-form-success |
Actions involving the item list | |
Sending search queries | products-search-submit |
Selecting item categories | open-category |
Sorting items | sort-products |
Viewing product info | open-product-item |
Enabling filters (meaning each time the Show button is clicked after filters are selected) | apply-filters |
Action | ID |
---|---|
Cart actions | |
Clicks on the Add to cart button | add-to-cart |
Go to cart button clicks (appears instead of the Add to cart button) | open-cart-from-product |
Clicks on the Go to cart button displayed in the page header | open-cart-from-header |
Opening the order form in the basket | open-check-out-form-from-cart |
Sending information via the order form from the basket | send-check-out-form-from-cart |
Each instance the “Thank you for your order” message is displayed in the basket | check-out-form-success-from-cart |
1-click purchases | |
Each instance a user opens the Buy in 1 click form | open-check-out-form |
Each instance information is sent via the Buy in 1 click form | send-check-out-form |
Each instance the “Thank you for your order” message is displayed | check-out-form-success |
Actions involving the item list | |
Sending search queries | products-search-submit |
Selecting item categories | open-category |
Sorting items | sort-products |
Viewing product info | open-product-item |
Enabling filters (meaning each time the Show button is clicked after filters are selected) | apply-filters |
- Set up the actions you want to track via Yandex.Webmaster.
- In Yandex.Metrica, use the left menu to go to the Goals page and click Add goal.
- In the Name field, enter a name for the goal to create.
- Choose the JavaScript event goal type.
Specify the action ID as shown in the table above.
- 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.
Sales funnel
To track the sales funnel, use a “multi-step goal”. Read the multi-step goal requirements.
To enable Yandex.Metrica to track goal completion, set the same tag for the Turbo pages and your site's pages.
- Find the Sessions that condition group and click
.
- Choose the condition.
- Click Apply.
- Click Dimensions.
- Choose the value.
- Click Apply.
- In Yandex.Webmaster, set up the Add to cart button.
- 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. To set up the steps, use:
- Choose the “goal ID event” condition.
- Enter the add-to-cart value in the field.
Use the reachGoal method on site pages.
- 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.
The goal ID to track clicks on the “Add to cart” button (required condition)Custom Java Script eventWhen you create a goal, you set its ID. When a goal is completed, the reachGoal method is called, and the specified ID is passed to it.
Conditions for tracking pageviewsCondition 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.ExampleIf 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.ExampleIf 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.ExampleIf 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.ExampleIf 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. 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.
See the examples for using “url:” criteria.
- 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.
- In Yandex.Webmaster, set up the Buy in 1 click form.
- 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. For the condition, choose the “goal ID event”. For example:
- Step 1 – Opening the form. For the ID, specify open-check-out-form.
- Step 2 – Sending information. For the ID, specify send-check-out-form.
- 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.
Create a multi-step goal with the steps of making an order on your site. If the user who placed the order viewed the Turbo page during the session, Yandex.Metrica will include this session in Turbo pages statistics.
You can view statistics for Turbo pages as follows:
Below is an example of how to track a 1-click purchase. You can also track other actions.