Installing a tag on a Turbo page

You can use a Yandex.Metrica tag to collect statistics about sessions on Turbo pages.

We recommend using the same tag on your site and Turbo pages to make it easier to work with statistics.

How to create a separate tag for Turbo pages
  1. Log in to Yandex.Metrica. If you don't have an account, register.
  2. On the page with the list of tags, add a tag. The tag setup page opens .
  3. Fill in the information:
    • Tag name — Enter any name.
    • Site URL — Enter the site domain that you use Turbo pages for.
  4. Accept the terms of use.
  5. Click Create a tag.

You can enable additional settings for the tag.

Attention. If you use the ad builder to generate Turbo pages for ads in Yandex.Direct, the Yandex.Metrica tag is created for these pages automatically.
  1. Installing a tag on a Turbo page
  2. Goals for informational sites
  3. Goals for your online store
  4. Viewing statistics

Installing a tag on a Turbo page

There are several ways to install a Yandex.Metrica tag:

Go to Turbo pages → Settings and do the following:

  1. Under General site information, choose Yandex.Metrica in the Tags field and enter the tag ID.
  2. Save your changes.
Note. If you specified a tag in an RSS feed and in the Yandex.Webmaster interface, the RSS data will have priority.

Goals for informational sites

To track the users' interaction with the Turbo page elements, use a “JavaScript event” goal.

Linking an existing goal
  1. Add the turbo:goal element to an RSS feed:
    ...
    <turbo:goal type="yandex" turbo-goal-id="goal-link" name="Order" id="TARGET" />
    <turbo:content>
       <![CDATA[
           ...
       ]]>
    </turbo:content>
    where
    • name — goal name
    • id — goal ID
    • turbo-goal-id — ID to assign to the Turbo page content
  2. 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>    
        <![CDATA[        
            <p><a href="http://example.com/" data-goals="goal-link">Text</a></p>
        ]]>
    </turbo:content>
Creating a new goal
  1. Add the turbo:goal element to an RSS feed:
    ...
    <turbo:goal type="yandex" turbo-goal-id="goal-link" name="Order" id="TARGET" />
    <turbo:content>
       <![CDATA[
           ...
       ]]>
    </turbo:content>
    where
    • name — goal name
    • id — goal ID
    • turbo-goal-id — ID to assign to the Turbo page content
  2. 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>
        <![CDATA[
            <p><a href="http://example.com/" data-goals="goal-link">Text</a></p>
        ]]>
    </turbo:content>
  3. In Yandex.Metrica, go to Settings → Goals and click Add goal.
  4. In the Name field, enter a name for the goal to create.
  5. Set the option to JavaScript event.
  6. Specify the ID of the goal.
  7. Click Add goal and save changes.


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 Turbo pages are generated based on an YML file for your online store, you can track conversions for several types of goals:

Clicks on the “Add to cart” button

Sales funnel

Clicks on the “Add to cart” button

In this case, a “Java Script event” goal is used.

  1. In Yandex.Webmaster, set up the Add to cart button.
  2. In Yandex.Metrica, go to Settings → Goals and click Add goal.
  3. In the Name field, enter a name for the goal to create.
  4. Set the option to JavaScript event.
  5. Enter the add-to-cart value as the ID.
  6. Click Add goal.

The created goal can be used in most Yandex.Metrica reports. You can also track conversions by goal using the Conversions report.

Sales funnel

To track the sales funnel, use a “multi-step goal”. Read the multi-step goal requirements.

To enable Yandex.Metrica to track the goal completion, set the same tag for the Turbo pages and your site's pages.

Viewing Turbo pages

Create a multi-step goal with the steps of making an order on your site. If the user who made the order viewed the Turbo page during the session, Yandex.Metrica will include this session in statistics for Turbo pages.

You can view statistics for Turbo pages as follows:

  1. In a Yandex.Metrica report, such as “Sources, summary”, click .
  2. Choose the condition Behavior → Turbo page → Turbo.
  3. Click Apply.
Clicking the Add to cart button on the Turbo page
  1. In Yandex.Webmaster, set up the Add to cart button.
  2. In Yandex.Metrica, go to Settings → Goals.
  3. Click Add goal.
  4. In the Name field, enter a name for the goal to create.
  5. Set the option to Multi-step goal.
  6. Add the steps. To set up the steps, use:

    The goal ID to track clicks on the “Add to cart” button (required condition)
    1. For the condition, choose the “goal ID event”.
    2. Enter the add-to-cart value in the field.
    Custom Java Script event

    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.

    2. For the condition, choose the “goal ID event”.
    3. Specify the ID of the goal.
    Conditions 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 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.

    See the examples for using “url:” criteria.

  7. Click Add goal. The created goal is shown in the list of goals.
  8. Click Save. Yandex.Metrica begins collecting statistics within a few minutes after saving settings.

Viewing statistics

Yandex.Metrica links a session to statistics for Turbo pages if the Turbo page was viewed during it.

There are several ways to track statistics depending on the tag type:

Separate tag
In this case, view Yandex.Metrica standard reports.
Tag installed on a regular or mobile version of your site

In this case, you can get a report as follows:

  1. In a Yandex.Metrica report, such as “Sources, summary”, click .
  2. Choose the condition Behavior → Turbo page → Turbo.
  3. Click Apply.

The data in the report is updated using the selected value.