Query Replo analytics
query_replo_analyticsRun read-only ClickHouse SQL over a project's Replo analytics for traffic, conversion, revenue, and session-level questions. Queryable public tables are session_attribution, events_computed, currency_exchange_rates, daily_page_rollups, daily_namespace_rollups, and daily_namespace_purchase_rollups. Only SELECT/WITH queries are accepted, and project-scoped tables are automatically restricted to the requested project and its authorized same-workspace, same-store siblings. For table columns, query examples, and limits, see the Replo Public API analytics query docs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Run a read-only analytics query for a project. Rules: - Use SELECT or WITH queries only. - Do not add project or namespace filters; project scoping is enforced server-side. - Use session_attribution(since, until) for cross-project session and attributed revenue; stored computed metrics and page rollups are project-local. - Session revenue repeats across visited pages: deduplicate by subject for totals. Attributed revenue splits credit across eligible pageviews before domain filters. - Aggregate-state rollup columns must use the matching ClickHouse merge function, such as countMerge, uniqMerge, or sumMerge, and queries must group by selected dimensions. - Maximum execution time: 60 seconds. - Maximum result rows: 100000. Queryable tables: Parameterized view: session_attribution(since='YYYY-MM-DD', until='YYYY-MM-DD'), inclusive UTC dates. Computes USD purchase, session, and equal-pageview attributed revenue across authorized sibling projects within that window, before domain filters. Cart/checkout views receive no attribution. Deduplicate sessionRevenueUsd by subject before summing. Inherits source row policies. Project scoped: yes. ```sql session_attribution ( subject UUID, date DateTime64(3), name LowCardinality(String), domain String, path String, title String, purchaseRevenueUsd Float64, sessionRevenueUsd Float64, sessionPurchaseCount UInt64, attributedRevenueUsd Float64 ) ``` Raw events with project-local computed session metrics. Use session_attribution for revenue across linked projects. Project scoped: yes. ```sql events_computed ( subject UUID, date DateTime64(3), name LowCardinality(String), path String, domain String, currencyCode String, subjectPurchaseSum Float64, subjectPurchaseCount Float64, subjectPurchaseFraction Float64, subjectPurchaseFractionalSum Float64, title String ) ``` Currency exchange rates for multi-currency reporting. Project scoped: no. ```sql currency_exchange_rates ( date Date, code String, rate Float32 ) ``` Pre-aggregated daily page metrics by day, domain, path, and UTM source. Revenue/conversion attribution is project-local; use session_attribution across linked projects. Project scoped: yes. ```sql daily_page_rollups ( day Date, domain String, path String, utm_source String, views_state AggregateFunction(count), unique_sessions_state AggregateFunction(uniq, UUID), converting_sessions_state AggregateFunction(uniq, UUID), fractional_conversions_state AggregateFunction(sum, Float64), fractional_revenue_usd_state AggregateFunction(sum, Float64), session_conversions_state AggregateFunction(sum, UInt64), session_revenue_usd_state AggregateFunction(sum, Float64) ) ``` Pre-aggregated daily project traffic metrics by day and UTM source. Project scoped: yes. ```sql daily_namespace_rollups ( day Date, utm_source String, views_state AggregateFunction(count), unique_sessions_state AggregateFunction(uniq, UUID), converting_sessions_state AggregateFunction(uniq, UUID) ) ``` Pre-aggregated daily purchase metrics by day and UTM source. Project scoped: yes. ```sql daily_namespace_purchase_rollups ( day Date, utm_source String, purchase_count_state AggregateFunction(count), total_revenue_usd_state AggregateFunction(sum, Float64), unique_purchasing_sessions_state AggregateFunction(uniq, UUID) ) ``` | |
| projectId | Yes |