π Open source, privacy-first web analytics β a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Merge pull request #584 from Swetrix/feature/live-visitors-visualisation
Andrii Romasiun435e3e8d1f41
diff --cc docs/content/docs/api/stats.mdxindex 0f6cae908,1d9dc8fef..495f1a420--- a/docs/content/docs/api/stats.mdx+++ b/docs/content/docs/api/stats.mdx@@@ -1257,73 -1268,9 +1268,73 @@@ curl 'https://api.swetrix.com/v1/log/usThe parameters are similar to the [`/log` endpoint](#get-v1log).+### GET /v1/log/journeys++Returns the most popular journeys β the ordered sequences of pages visitors viewed within a session. This is the data behind the Journeys tab of the dashboard.++```bash+curl 'https://api.swetrix.com/v1/log/journeys?pid=YOUR_PROJECT_ID&period=7d&steps=3&journeys=20'\+ -H "X-Api-Key: ${SWETRIX_API_KEY}"+```++Each journey in the response is a `path` (an array of page paths) together with `value` β the number of sessions that followed it. The response also includes `totalSessions`, the total number of sessions in the period.++#### Parameters++In addition to the parameters of the [`/log` endpoint](#get-v1log):++<hr />++**steps** (optional, default: `3`)++How many pages deep each journey goes (2 - 10).++<hr />++**journeys** (optional, default: `20`)++How many of the most popular journeys to return (5 - 100).++### GET /v1/log/journey-sessions++Returns the sessions that viewed a given page at a given journey step.++```bash+curl 'https://api.swetrix.com/v1/log/journey-sessions?pid=YOUR_PROJECT_ID&period=7d&step=2&page=%2Fpricing'\+ -H "X-Api-Key: ${SWETRIX_API_KEY}"+```++#### Parameters++In addition to the parameters of the [`/log` endpoint](#get-v1log):++<hr />++**step** (required)++The journey step the page was visited at (1-indexed).++<hr />++**page** (required)++The page path visited at the given step.++<hr />++**take** (optional, default: `30`, max: `150`)++The number of sessions to return per page.++<hr />++**skip** (optional, default: `0`)++The number of sessions to skip (for pagination).+### GET /v1/log/chart- Returns data for the main chart (visits, uniques, sessions duration, etc.) grouped by time bucket. This is useful when you only need the chart data without other aggregations.+ Returns data for the main chart (visits, uniques, sessions duration, concurrent live visitors, etc.) grouped by time bucket. This is useful when you only need the chart data without other aggregations.```bashcurl 'https://api.swetrix.com/v1/log/chart?pid=YOUR_PROJECT_ID&timeBucket=day&period=7d'\