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
    • Start testing with double trial credits
    • 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 Managed Service for ClickHouse®
  • Getting started
    • All tutorials
    • Adding data to the database
    • Migrating data to Managed Service for ClickHouse® using ClickHouse®
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Sharding tables
    • Data resharding in a cluster
    • Using a hybrid storage
    • Fetching data from Managed Service for Apache Kafka®
    • Fetching data from RabbitMQ
    • Exchanging data with Yandex Data Processing
    • Configuring Yandex Cloud DNS for cluster access from other cloud networks
    • Analyzing Yandex Object Storage logs in Yandex DataLens
    • Configuring Managed Service for ClickHouse® for Graphite
    • Saving a Yandex Data Streams data stream in Managed Service for ClickHouse®
    • Migrating a database from Google BigQuery
    • Delivering data from Managed Service for Apache Kafka® using Yandex Data Transfer
    • Migrating data from Yandex Direct using Yandex Cloud Functions, Yandex Object Storage, and Yandex Data Transfer
    • Loading data from Yandex Object Storage to Managed Service for ClickHouse® using Yandex Data Transfer
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from MySQL® to ClickHouse® using Yandex Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Loading data from Yandex Managed Service for YDB to Managed Service for ClickHouse® using Yandex Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for ClickHouse® using Yandex Data Transfer
    • Entering data into storage systems
    • Using parameters
    • Examples of creating QL charts
    • Web analytics with funnels and cohorts calculated based on Yandex Metrica data
    • AppMetrica: direct connection
    • AppMetrica: data export, post-processing, and visualization
    • Loading data from Yandex Metrica to a ClickHouse® data mart
    • Yandex Tracker: data export and visualization
    • Retail chain's dashboard based on a ClickHouse® DB
    • Analyzing sales and locations of pizzerias based on data from the ClickHouse® database and Marketplace
    • Geocoding with the Yandex Maps API for data visualization in DataLens
    • Importing data from Object Storage, processing and exporting to Managed Service for ClickHouse®
    • Working with data using Query
    • Federated data queries using Query
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Required paid resources
  • Getting started
  • Prepare and activate your transfer
  • Test the transfer
  • Delete the resources you created
  1. Tutorials
  2. Loading data from Yandex Metrica to a ClickHouse® data mart

Loading data from Yandex Metrica to a ClickHouse® data mart

Written by
Yandex Cloud
Updated at April 25, 2025
  • Required paid resources
  • Getting started
  • Prepare and activate your transfer
  • Test the transfer
  • Delete the resources you created

Note

You can transfer data from a Yandex Metrica source if the Metrica Pro package is enabled or when using Data Streaming from Yandex Metrica.

With Data Transfer, you can transfer data from a Yandex Metrica tag to a ClickHouse® cluster. Such a transfer ensures the completeness of the data you transfer from Yandex Metrica and allows:

  • Processing data with ClickHouse® tools.
  • Streaming data from ClickHouse® to other locations.
  • Visualizing data using Yandex DataLens or other services.

To transfer data:

  1. Prepare and activate your transfer.
  2. Test the transfer.

If you no longer need the resources you created, delete them.

Required paid resourcesRequired paid resources

The support cost includes:

  • Managed Service for ClickHouse® cluster fee: Using computing resources allocated to hosts (including ZooKeeper hosts) and disk space (see Managed Service for ClickHouse® pricing).
  • Fee for using public IP addresses if public access is enabled for cluster hosts (see Virtual Private Cloud pricing).
  • Metrica Pro fee.
  • Per-transfer fee: Using computing resources and the number of transferred data rows (see Data Transfer pricing).

Getting startedGetting started

Set up your infrastructure:

  1. Select a Yandex Metrica tag or create and install a new one.

  2. Create a Managed Service for ClickHouse® target cluster in any suitable configuration.

Prepare and activate your transferPrepare and activate your transfer

  1. Create an endpoint for the Metrica source.

    Hits and sessions are transferred as separate tables.

  2. Create an endpoint for the target:

    • Database type: ClickHouse

    • Endpoint parameters → Connection type: Managed cluster

      Select a target cluster from the list and specify its connection settings.

  3. Create a transfer of the Replication type that will use the created endpoints.

  4. Activate your transfer.

A transfer only moves the current data and does not affect historical data. If you deactivate and activate the transfer again:

  1. Data obtained by the Yandex Metrica tag before the transfer was disabled will not be transferred.

  2. Depending on the cleanup policy selected in the target endpoint, the existing data tables will be:

    • Drop: Deleted along with the data and created again with the same names.
    • Truncate: Purged of existing data without removing the tables and schemas.
    • Don't cleanup: Used for further data writes.

Test the transferTest the transfer

  1. Wait for the transfer status to change to Replicating.

  2. Make sure the data from the Yandex Metrica tag has been moved to the Managed Service for ClickHouse® database:

    1. Connect to the cluster using clickhouse-client.

    2. Check whether the hit and session tables have appeared in the database:

      SELECT table FROM system.tables
      WHERE database = '<ClickHouse®_database_name>'
      

      Result:

      ┌─table───────────────────────┐
      │ hits_dt...                  │
      │ visits_dt...                │
      └─────────────────────────────┘
      
    3. Check whether the hit and session tables contain data from the tag:

      SELECT * FROM <name_of_hit_or_visit_table>
      

Delete the resources you createdDelete the resources you created

Note

Before deleting the created resources, deactivate the transfer.

Some resources are not free of charge. To avoid paying for them, delete the resources you no longer need:

  1. Delete the transfer.
  2. Delete the endpoints for both the source and target.
  3. Delete the Managed Service for ClickHouse® cluster.
  4. Delete the Yandex Metrica tag from your Yandex Metrica Pro account.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
AppMetrica: data export, post-processing, and visualization
Next
Yandex Tracker: data export and visualization
© 2025 Direct Cursus Technology L.L.C.