Dashtics Query Language — a structured, safe query language for your site analytics. Looks like SQL, runs only on your own data.
DQL is a structured, safe query language for your site analytics. It looks like SQL but only operates on your own data — no injections, no table scans, no cross-site leaks. Every identifier is validated server-side against a fixed allowlist before execution.
Create a free account to access the DQL editor in the Reports page. Press Ctrl+Enter (or ⌘+Enter) to run a query.
Selects which metrics to calculate. Required. Comma-separate multiple metrics. Use AS alias to rename a column in results and reference it in HAVING or ORDER BY.
Always analytics. Optional clause — the schema is fixed to your site's data.
Rolling window shorthand or exact custom range. Use DURING for named calendar periods (see below).
| Form | Meaning | Example |
|---|---|---|
| today | Current day so far | SINCE today |
| -7d | Last 7 days | SINCE -7d |
| -30d | Last 30 days (default) | SINCE -30d |
| -90d | Last 90 days | SINCE -90d |
| "YYYY-MM-DD" | Custom range with UNTIL | SINCE "2025-01-01" UNTIL "2025-03-31" |
Named calendar ranges — easier to read than rolling windows and snapped to clean boundaries (e.g. the full month, not "30 days ago").
| Period | Meaning |
|---|---|
| today | Current day (midnight to now) |
| yesterday | Previous full day |
| this_week / last_week | ISO week (Monday–Sunday) |
| this_month / last_month | Calendar month |
| this_quarter / last_quarter | Calendar quarter (Q1–Q4) |
| this_year / last_year | Full calendar year |
Filters rows before aggregation. Chain multiple conditions with AND or OR. Standard SQL precedence: AND binds tighter than OR.
Shorthand for time-based GROUP BY. Makes intent clearer and auto-sorts the time axis ascending so charts read left-to-right. Accepts the same time dimensions as GROUP BY.
Breaks results down by one or more dimensions. Without it, a single summary row is returned.
Filters after aggregation — useful to exclude noise (e.g. pages with fewer than 10 sessions). Uses the metric name or alias from SHOW. Supports >, <, >=, <=, =, != and AND / OR.
Explicit sort — when specified, overrides auto-derived ordering. Reference a metric name, its alias (from AS), or a dimension. Auto-sort: time dims → ASC, other dims → first metric DESC.
| Operator | Meaning | Example |
|---|---|---|
| = | Exact match | channel = "organic" |
| != | Does not match | device != "tablet" |
| CONTAINS | Substring match (case-insensitive) | page CONTAINS "/blog" |
| NOT CONTAINS | Does not contain substring | page NOT CONTAINS "?utm" |
| STARTS WITH | Prefix match (case-insensitive) | page STARTS WITH "/blog" |
| ENDS WITH | Suffix match (case-insensitive) | page ENDS WITH ".html" |
| IN (...) | Matches any value in the list | channel IN ("organic", "referral") |
| NOT IN (...) | Matches none of the values | country NOT IN ("NL", "BE") |
| BETWEEN … AND … | Inclusive range | page BETWEEN "/a" AND "/z" |
| NOT BETWEEN … AND … | Outside range | page NOT BETWEEN "/a" AND "/z" |
| IS NULL | Value is absent / empty | referrer IS NULL |
| IS NOT NULL | Value is present | utm_campaign IS NOT NULL |
| > < >= <= | Numeric comparison — HAVING only | HAVING sessions > 100 |
| AND | Both conditions must be true (binds tighter than OR) | device = "mobile" AND country = "NL" |
| OR | Either condition must be true | channel = "organic" OR channel = "direct" |
| Metric | Description | Unit |
|---|---|---|
| sessions | Unique browser sessions | count |
| pageviews | Total page loads | count |
| visitors | Unique visitors | count |
| bounce_rate | Percentage of single-page sessions | % |
| avg_duration | Average time on page (per page load) | seconds |
| pages_per_session | Average pages viewed per session | decimal |
| avg_session_duration | Average total time in session | seconds |
| revenue | Total order revenue (ecommerce) | € |
| orders | Number of completed orders (ecommerce) | count |
| avg_order_value | Revenue ÷ orders (ecommerce) | € |
| conversion_rate | Orders ÷ sessions × 100 (ecommerce) | % |
| Dimension | In WHERE? | Description | Example values |
|---|---|---|---|
| channel | ✓ | Traffic channel | organic, direct, paid, referral, social |
| country | ✓ | Visitor country (ISO code) | NL, US, DE |
| page | ✓ | Page URL path | /blog/post-1 |
| device | ✓ | Device type | desktop, mobile, tablet |
| browser | ✓ | Browser name | Chrome, Firefox, Safari |
| os | ✓ | Operating system | Windows, macOS, iOS, Android |
| city | ✓ | Visitor city | Amsterdam, Berlin, London |
| language | ✓ | Browser language | nl, en, en-US, de |
| referrer | ✓ | HTTP referrer URL | google.com, t.co |
| utm_source | ✓ | UTM source param | google, newsletter |
| utm_medium | ✓ | UTM medium param | cpc, email |
| utm_campaign | ✓ | UTM campaign param | spring-sale |
| date | — | Per-day breakdown (sorts ASC) | 2025-08-01 |
| week | — | ISO week start date (sorts ASC) | 2025-07-28 |
| month | — | Month start date (sorts ASC) | 2025-08-01 |
| hour | — | Hour of day 0–23 UTC (sorts ASC) | 0, 9, 14, 23 |
| weekday | — | Day of week 1=Mon … 7=Sun (sorts ASC) | 1, 5, 7 |
Top channels by sessions (last 30 days)
Daily pageview trend (last 7 days)
Last month — high-traffic pages only (HAVING + alias)
Paid + social channels — multi-channel filter
Weekly traffic trend — organic only
The DQL editor is built into the Reports page. Sign up free — no credit card needed.
Create free account →