Import Aggregated Metric data

Importing Aggregated Metrics takes three steps: enable change tracking in your warehouse, connect and configure the source in Amplitude, then make sure your table matches the expected schema.

For what Aggregated Metrics are, which metric and data types Amplitude supports, and the requirements your warehouse must meet, refer to Aggregated Metrics.

Import metric data

Aggregated Metrics (fka Warehouse Metrics) supports Snowflake.

Enable change tracking

If this is your first time importing from this table, enable change tracking in Snowflake:

sql
ALTER TABLE YOUR_DATABASE.YOUR_SCHEMA.YOUR_METRICS_TABLE
  SET DATA_RETENTION_TIME_IN_DAYS = 7;

ALTER TABLE YOUR_DATABASE.YOUR_SCHEMA.YOUR_METRICS_TABLE
  SET CHANGE_TRACKING = TRUE;

Snowflake Standard Edition

On Snowflake Standard Edition, the maximum retention time is one day. Set your sync frequency to 12 hours.

Connect and configure

Follow the instructions in Snowflake Data Import to connect to your Snowflake instance.

Data specifications

Your metrics table must include specific required fields and can optionally include additional fields. You must include at least one metric or dimension field.

Required fields

Time conversion

Amplitude requires the incoming time in milliseconds from the Unix epoch. Use Snowflake’s built-in conversion functions or other tooling in your data pipeline to convert to this format before Amplitude ingests the data.

Optional fields

Metric fields

Your metrics table must include at least one metric or dimension field.

Example

json
{
  "time": "1762813185",
  "user_id": "user_12345",
  "total_revenue": 1543.5,
  "order_count": 12,
  "ltv": 15430.0,
  "health_score": "green",
  "is_paid": true
}

Query template

sql
SELECT
  event_date AS "time",
  user_id AS "user_id",
  total_revenue AS "total_revenue",
  order_count AS "order_count",
  ltv AS "ltv",
  health_score AS "health_score",
  is_paid_customer AS "is_paid"
FROM DATABASE_NAME.SCHEMA_NAME.METRICS_TABLE
WHERE event_date >= CURRENT_DATE - INTERVAL '30 days'

Was this helpful?

For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

On this page