Skip to main content
The Explorer runs read-only SQL on your project’s raw events. Use it when a report or a dashboard does not answer your question.

Part 1: Open the Explorer

1

Open the SQL tab

Click Explorer in the left navigation, then click Data. The SQL tab opens.
2

Load an example

Click Examples (or load an example) and pick a query. It goes into the query box.
3

Run the query

Change the query and click Run query. The results show below as a table.
You query the table raw_events. Each row is one event. For session counts, read the table sessions (one row for each session of the date range; see Explorer). Read fields in context and properties with JSONExtractString() or JSONExtractFloat(). See the data catalog for every column.

Part 2: Useful queries

Top custom events in the date range
Visitors by acquisition channel
Revenue by plan
{{date_from}} and {{date_to}} follow the date range in the page header. Use both or neither.

Part 3: Know the limits

  • Write one SELECT or WITH statement, without comments. Only raw_events, sessions, session_events and your own subqueries are allowed.
  • A result has at most 200 rows. A query stops after 8 seconds.
  • You can run 10 queries a minute, and a project can run 30.
  • raw_events includes bot rows. Exclude them with JSONExtractString(context, 'device') != 'bot'.
  • Use uniqExact(message_id) for exact event counts, because a client retry can repeat a row.

Part 4: Save a query as a chart

The Explorer does not save queries. To keep one, open a dashboard, click Add chart, click Blank chart, paste the query into the SQL query box, name the columns to draw, and click Save Chart. See How to build a custom dashboard.
From an AI tool, the MCP tool execute_query runs SQL with the same rules. It needs the query:read scope. See MCP.