Creating a Metrica connection
Note
For the Metrica Pro package, real-time data streaming is available. For more information, see this guide
To create a Yandex Metrica connection:
Warning
If you use a new DataLens object model with workbooks and collections:
- Go to the DataLens home page
. In the left-hand panel, select - Open the workbook, click Create in the top-right corner, and select the appropriate object.
Follow the guide from step 3.
-
Go to the connections page
. -
Click Create connection.
-
Select Metrica as the connection type.
-
Specify the connection parameters:
-
OAuth token: Click Get token or enter the OAuth token manually to access the Yandex Metrica data.
-
Tag: 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.
-
-
Click Create connection.
-
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 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:
- Switch to an account that has access to Yandex Metrica.
- Use the link
to get a token. If necessary, allow access to the application, then copy the token. - Switch to an account that has access to Yandex DataLens.
- 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