Installing a tag on a Turbo page

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.

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.

  1. Installing a tag on a Turbo page
  2. Goals for an informational site
  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 an informational site

To track the users' interaction with 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="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
  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,goal-link2">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="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
  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,goal-link2">Text</a></p>
        ]]>
    </turbo:content>
  3. In Yandex.Metrica, go to Settings, open the Goals tab, 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:

Tracking user actions

Sales funnel

Tracking user actions

You can track the following actions:
  • Clicks on the Add to cart button
  • Opening a Buy in 1 click form.
  • Sending information through a Buy in 1 click form.

To do this, use the “Java Script event” goal.

  1. In Yandex.Webmaster, set up the Add to cart button or Buy in 1 click form.
  2. In Yandex.Metrica, go to Settings, open the Goals tab, 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. For the ID, enter the value:
    • add-to-cart to track Add to cart button clicks.
    • open-check-out-form to track the opening of the Buy in 1 click form.
    • send-check-out-form to track the submission of via form.
  6. Click Add goal.

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 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:

  1. In a Yandex.Metrica report, such as “Sources, summary”, click .
  2. Choose the condition Behavior → Turbo page → Turbo.
  3. Click Apply.
Clicking “Add to cart”
  1. In Yandex.Webmaster, set up the Add to cart button.
  2. In Yandex.Metrica, go to Settings and open the Goals tab.
  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.
Opening the “Buy in 1 click” form and submitting information
  1. In Yandex.Webmaster, set up the Buy in 1 click form.
  2. In Yandex.Metrica, go to Settings and open the Goals tab.
  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. 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.
  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.

Additionally, you can use the special Turbo pages report.

If you were unable to independently check the tag, follow the recommendations below.

This might happen for the following reasons:

  • The tag is installed incorrectly. For example, the CMS modified the code snippet. Reinstall the tag or contact the support service for your CMS.
  • Broken scripts are preventing the Yandex.Metrica tag from working on the site. You can check this in the browser console.

This means that information is being transmitted to Yandex.Metrica. However, the data might not be shown in reports for any of the following reasons:
  • Data is sent to a tag with a different number.
  • The Filters tab in the tag settings has overly strict filters defined. Remove unneeded filters.
  • The Filters tab in the tag settings has the Don't count my sessions filter enabled. This means that the tag doesn't register your own sessions. Try accessing the site with your browser in “incognito” mode.