Transferring data from a Yandex Metrica source endpoint
Data Transfer enables you to transfer data from a Yandex Metrica
- Review possible data transfer scenarios.
- Set up a source endpoint in Yandex Data Transfer.
- Set up one of the supported data targets.
- Create and launch the transfer.
- Perform the required database tasks while monitoring the transfer status.
- If you run into any problems, check the available solutions for troubleshooting.
Yandex Metrica data transfer scenarios
Data Transfer enables you to transfer metrics from Yandex Metrica
- Processing data with ClickHouse® tools.
- Streaming data from ClickHouse® to other locations.
- Visualizing data with Yandex DataLens
or other services.
See this tutorial on how to transfer Yandex Metrica tag data to a ClickHouse® cluster.
For a detailed description of other possible Yandex Data Transfer scenarios, see Tutorials.
Configuring the Metrica source endpoint
Note
You can transfer data from a Yandex Metrica source if the Metrica Pro
When creating or updating an endpoint, configure access to Yandex Metrica
-
Tag numbers: Specify the numbers of the tags
the data will be coming from. -
Token: Specify the token required to access the tags. To obtain it, follow this link
. The token’s validity period is one year. In this case, the following applies:- Activated transfers continue to operate after the token expires.
- Modifying the list of counters you need to transfer will trigger a transfer error if the token has expired or if the token owner lacks access to the counters.
- Deactivating a transfer deletes the export, so you will need a current token to reactivate it. In the event of a transfer error, the export is preserved, and reactivation does not require a token refresh.
-
Optionally, specify a time interval to export data for. This option is supported for the Snapshot and increment transfer type. The end date must be at least 7 days later than the start date.
-
Hits: Select whether information about hits should be transferred.
- Fields: Select the hit fields to export. In addition to the fields you select, there are certain mandatory fields that are always exported.
-
Sessions: Select whether information about sessions (visits) should be transferred.
- Fields: Select the session fields to export. In addition to the fields you select, there are certain mandatory fields that are always exported.
-
Endpoint type:
metrika_source. -
counter_ids: Numbers of the tags that will send data. -
token.raw: Token required to access the tags. To obtain it, follow this link . The token’s validity period is one year. In this case, the following applies:- Activated transfers continue to operate after the token expires.
- Modifying the list of counters you need to transfer will trigger a transfer error if the token has expired or if the token owner lacks access to the counters.
- Deactivating a transfer deletes the export, so you will need a current token to reactivate it. In the event of a transfer error, the export is preserved, and reactivation does not require a token refresh.
-
streams: Parameters of transmitted data:-
type: Data type. Specify one of these values:METRIKA_STREAM_TYPE_HITS: Hits (obsolete, not updated)METRIKA_STREAM_TYPE_HITS_V2: HitsMETRIKA_STREAM_TYPE_VISITS: Visits
-
columns: List of fields to export. You can view them in the management console. In addition to the fields you select, there are certain required fields that are always exported.
-
Configuration file structure example:
resource "yandex_datatransfer_endpoint" "<endpoint_name_in_Terraform>" {
name = "<endpoint_name>"
settings {
metrika_source {
counter_ids = [<tag_numbers>]
token {
raw = "<token>"
}
streams {
type = "<data_type>"
columns = ["<field_list>"]
}
}
}
}
-
counterIds: Numbers of the tags that will send data. -
token.raw: Token required to access the tags. To obtain it, follow this link . The token’s validity period is one year. In this case, the following applies:- Activated transfers continue to operate after the token expires.
- Modifying the list of counters you need to transfer will trigger a transfer error if the token has expired or if the token owner lacks access to the counters.
- Deactivating a transfer deletes the export, so you will need a current token to reactivate it. In the event of a transfer error, the export is preserved, and reactivation does not require a token refresh.
-
streams: Parameters of transmitted data:-
type: Data type. Specify one of these values:METRIKA_STREAM_TYPE_HITS: Hits (obsolete, not updated)METRIKA_STREAM_TYPE_HITS_V2: HitsMETRIKA_STREAM_TYPE_VISITS: Visits
-
columns: List of fields to export. You can view them in the management console. In addition to the fields you select, there are certain required fields that are always exported.
-
For more about the settings, see this guide
Configuring the target
Configure the supported data target:
For a full list of sources and targets supported in Yandex Data Transfer, see Available transfers.
Once you have configured the source and target, create and launch the transfer.
ClickHouse® is a registered trademark of ClickHouse, Inc