Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex DataLens
    • Overview
    • Caching
    • Combining data
      • Creating a connection to files
      • Creating a connection to Yandex Documents
      • Creating a Google Sheets connection
      • Creating a Yandex Query connection
      • Creating a Yandex Metrica API connection
      • Creating an AppMetrica connection
      • Creating a Yandex Cloud Billing connection
      • Creating a Yandex Monitoring connection
      • Creating an API Connector connection
      • Creating a SpeechSense connection
  • Audit Trails events
  1. Connections
  2. Files and services
  3. Creating a Yandex Metrica API connection

Creating a Metrica connection

Written by
Yandex Cloud
Updated at March 31, 2025

Note

For the Metrica Pro package, real-time data streaming is available. For more information, see this guide.

To create a Yandex Metrica connection:

  1. Open the page for creating a new connection.

  2. Under Files and services, select the Metrica connection.

  3. Specify the connection settings:

    • OAuth token. Click Get token or enter the OAuth token manually to access the Yandex Metrica data.

    • Counter. Specify one or more tracking tags to connect to.

      Note

      If you want to get access for a username other than your current Yandex account or there is no relevant tag in the list, see Getting an OAuth token.

      You cannot connect multiple tags from different accounts at the same time.

    • Accuracy. Set the data accuracy (sampling rate). You can change the accuracy after you create the connection.

    • Leave the Automatically create a dashboard, charts, and a dataset on the connection option enabled if you need a folder with a standard set of datasets and charts and a ready-made dashboard.

  4. Click Create connection.

  5. Select a workbook to save your connection to or create a new one. If using legacy folder navigation, select a folder to save the connection to. Click Create.

  6. Enter a name for the connection and click Create.

Note

By default, Metrica data is exported for the last 60 days. If you add a filter by date to the chart, the Metrica filter will be reset. We recommend adding a filter by date as an offset relative to the current date.

Connections to the Yandex Metrica API do not support public access to the objects created based on it. To share a dashboard or chart created based on this connection, use one of the following methods:

  • Add a user to an organization or cloud and grant them access to a dashboard or chart.
  • Export data to a Managed Service for ClickHouse® cluster and use a connection to the ClickHouse® database as a source. To learn more about Managed Service for ClickHouse® pricing, see Pricing.

Getting an OAuth tokenGetting an OAuth token

You can specify an OAuth token of any Yandex account.

To get access to a Yandex Metrica tag for a username other than your current Yandex account, follow these steps:

  1. Switch to an account that has access to Yandex Metrica.
  2. Use the link to get a token. If necessary, allow access to the application, then copy the token.
  3. Switch to an account that has access to Yandex DataLens.
  4. Create a new connection to Yandex Metrica and paste the obtained token from the clipboard to the OAuth token field.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Creating a Yandex Query connection
Next
Creating an AppMetrica connection
© 2025 Direct Cursus Technology L.L.C.