provider web_analyticsweb_analytics GET
/api/projects/{project_id}/web_analytics/weekly_digest/ @utdk/posthog
/api/projects/{project_id}/web_analytics/weekly_digest/ Summarize web analytics
Summarizes a project's web analytics over a lookback window (default 7 days): unique visitors, pageviews, sessions, bounce rate, and average session duration with period-over-period comparisons, plus the top 5 pages, top 5 traffic sources, and goal conversions.
- compare query
- When true (default), include period-over-period change for each metric comparing against the prior equal-length period. Set to false to skip the comparison query (faster).
- boolean
- days query
- Lookback window in days (1–90). Defaults to 7.
- integer
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.webAnalyticsWeeklyDigest({
"compare": true,
"days": 7
})