All docs / Monitor
Analytics
Record your own events from apps and chart or query them over time.
Open in the consoleAnalytics stores data points you write from your apps (sign-ups, purchases, API calls per customer) and lets you chart and query them over time. Writing uses the same API as Cloudflare's Workers Analytics Engine.
Write data points
Create a dataset under Analytics and bind it to an app:
env.STATS.writeDataPoint({
indexes: [customerId], // what you group and sample by
blobs: ["checkout", country], // text fields: blob1, blob2, …
doubles: [amount, items], // numbers: double1, double2, …
});Writes do not wait for anything and never slow a request down.
Query and chart
On the dataset's page choose a time range, what to group by (blob1…blob20 or index1…index20) and what to measure: a count, or the sum, average, minimum or maximum of double1…. The result is drawn as a chart and a table. The same query runs over the API () for your own dashboards.