Skip to main content
The analytics query endpoint runs read-only ClickHouse SQL over these tables and views. Project-scoped tables are restricted to the requested project server-side.

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.
Raw events with project-local computed session metrics. Use session_attribution for revenue across linked projects. Project scoped: yes.
Currency exchange rates for multi-currency reporting. Project scoped: no.
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.
Pre-aggregated daily project traffic metrics by day and UTM source. Project scoped: yes.
Pre-aggregated daily purchase metrics by day and UTM source. Project scoped: yes.
Parameterized view: benchmark_comparison(window_days=1|7|30|90, since=‘YYYY-MM-DD’, until=‘YYYY-MM-DD’, channel=‘all’|‘affiliate’|‘email_sms’|‘ai_assistant’|‘paid_social’|‘paid_search’|‘organic_social’|‘other_tagged’|‘organic_search’|‘direct’|‘referral’, device=‘all’|‘mobile’|‘tablet’|‘desktop’, by_location=0|1, by_price_tier=0|1). One row per day and metric: this project’s own value over the window next to anonymized peers in the deepest cohort that passes (10+ brands, not low confidence). It keeps the asked-for axes and the narrowest category it can, trying country, then sub-region, then region at each category level, then drops price tier, then location. Price tiers are p0_25, p25_50, p50_75, p75_100: quartiles of peer brands’ 90-day AOV in the root category; a brand with under 30 orders in 90 days has none. A brand in the top 10% or top 1% is compared within p90_100 or p99_100 when that band has enough brands. Metrics: sessions, pages_per_session, add_to_cart_rate, checkout_rate, conversion_rate, orders, revenue_usd, aov_usd, revenue_per_session_usd. days_covered is how many of the window’s days have data: fewer than window_days means history is shorter than the window or the project had no sessions on some days. suspected_bot_sessions is how many sessions were taken out of my_value as suspected bot traffic (a channel and device with 3 times its usual sessions that view one page and don’t add to cart or buy); peers are cleaned the same way, and Insights still counts these sessions. Peer columns are NULL when no cohort passes. Inherits source row policies. Project scoped: yes.
Parameterized view: benchmark_trend(since, until, channel, device, by_location, by_price_tier, ma_days, ema_days). benchmark_comparison over 1-day windows plus moving averages per metric: my_sma and peer_sma over the last ma_days days, my_ema and peer_ema with an ema_days half-life. Days without a value are skipped, not counted as 0. Inherits source row policies. Project scoped: yes.
Anonymized daily peer statistics per cohort, readable across projects. One row per snapshot_date, window_days (1, 7, 30, 90), vertical, category_key (an industry path such as ‘Home & Garden > Kitchen & Dining’, or ” for the whole vertical), channel, device (mobile, tablet, desktop), location_key (the brand’s home location (location path such as ‘/Europe/Western Europe/Germany’, or ” for everywhere), price_tier (p0_25, p25_50, p50_75, p75_100, plus the overlapping top bands p90_100 and p99_100) and metric; ‘all’ (or ”) on an axis means not cut by it. blended is pooled across brands and one large brand can move it; p25 to p90 are brand-level quantiles. Rows need 10 brands. confidence is high, medium or low from the relative standard error: never show low rows to customers. Query with FINAL. Project scoped: no.
This project’s brand (root domain) and its value on every benchmark axis per day: vertical, category_path, location_path, 90-day AOV and orders, price tier, top bands (p90_100, p99_100) it’s in, and its root category’s tier boundaries (tier_p25_usd to tier_p99_usd, NULL until the category has enough priced peers). Query with FINAL. Project scoped: yes.
Parameterized view: benchmark_brand_metrics(start=‘YYYY-MM-DD’, end=‘YYYY-MM-DD’). This project’s brand totals per as_of day, 1/7/30/90-day window, channel and device (‘all’ included on both), as used for its benchmarks. days_covered is how many of the window’s days have data. Suspected bot traffic is taken out of sessions and page_views, and suspected_bot_sessions counts it. Prefer benchmark_comparison. Inherits source row policies. Project scoped: yes.
This project’s daily benchmark inputs by session channel and device, built from each session 3 hours after it starts (bots excluded). Each session is on exactly one row, so sum() the counts across rows and days. revenue_usd is converted at the purchase day’s rate. Project scoped: yes.
The root domain this project is benchmarked as: the one its pages got the most views on in the last 30 days. Query with FINAL. Project scoped: yes.

External metric views

Each connected integration below exposes parameterized views. Call them with named since and until dates (YYYY-MM-DD, inclusive). Views ending in _metrics_daily return date, metric, value, _metrics_totals return metric, current, previous, and _metrics_list return metric. The Google Analytics, Search Console and ROI report views also take settings JSON, Intelligems experience views take experience_id, and the Meta Ads views are described below the table. Credentials and project scope are injected server-side.

Meta Ads

The Meta Ads views take ad_account_id (the act_… id, or the bare number Ads Manager shows), since, until and filter (a JSON array of Meta insights filters, each {"field", "operator", "value"} over campaign, ad set or ad id, name or effective_status, or '[]' for every row), and return one row per campaign (meta_ads_campaign_daily) or per ad (meta_ads_ad_daily) per day: date, account_id (always the act_… form), currency, campaign_id, campaign_name, spend, impressions, clicks, purchases and purchase_value. The ad view adds adset_id, adset_name, ad_id, ad_name and the ad’s destination: destination_url as written in the creative, destination_host (lowercase, without www.) and destination_path (no query string or trailing slash), null for ads built from an existing post. Dates are days in the ad account’s timezone, money is in its currency, and purchases are Meta’s omni_purchase, the figures in Ads Manager’s Purchases column. Recent days are cached for an hour because Meta keeps crediting conversions for about a week. Meta applies the filters before returning rows, so they are the way to read one landing page’s ads, or a few campaigns, from a large account quickly. Unfiltered, the ad view reads every delivering ad for every day, which can be too slow for a large account over a long range; the query then fails with a message saying so.