Read
get_analytics
Returns 7-day engagement metrics (views, trend, clicks, intent, sparkline) for a published profile so the creator can evaluate performance and decide what to change.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| outlineId | string | — | The numeric Payload doc ID of the outline to query. Omit to read the authenticated creator's own outline. |
Response
| Field | Type | What it means |
|---|---|---|
| outlineId | string | The resolved numeric ID of the outline whose stats were fetched. |
| slug | string | The public URL handle for the profile (e.g. 'molly'). Empty string if the profile is unpublished. |
| window | string | Always '7d' — the fixed analytics window. A 90-day Pro window is a documented future extension. |
| stats | object | null | ProfileStats object when PostHog data is available; null when the profile is unpublished, POSTHOG_PERSONAL_API_KEY is unset, the API is unreachable, or the response cannot be parsed. |
| stats.views7d | number | Bot-filtered $pageview count for the profile's public URL in the last 7 days. |
| stats.viewsPrev7d | number | Bot-filtered $pageview count for the prior 7-day window (days 8–14). Used as the trend denominator. |
| stats.trendPct | number | null | Integer percent change in views vs the prior 7-day window. Null when viewsPrev7d is 0 (avoids division by zero on brand-new profiles). |
| stats.clicks7d | number | Count of card_button_clicked + social_icon_clicked events in the last 7 days — measures how often visitors act on CTAs. |
| stats.intent7d | number | Count of booking_intent + purchase_intent events in the last 7 days — measures high-signal conversion moments. |
| stats.sparkline | number[] | Array of 7 daily $pageview counts ordered oldest to newest (index 0 = 7 days ago, index 6 = yesterday/today). Use to render a trend line or detect traffic spikes. |
| note | string | Human-readable guidance present only when stats is null. Two possible values: 'Publish your profile to start collecting analytics.' (unpublished) or 'Analytics are warming up or not yet configured. Check back soon.' (PostHog unavailable). |
Example
Request
json
{
"outlineId": "42"
}Response
json
{
"outlineId": "42",
"slug": "sara",
"window": "7d",
"stats": {
"views7d": 312,
"viewsPrev7d": 204,
"trendPct": 53,
"clicks7d": 47,
"intent7d": 8,
"sparkline": [28, 31, 40, 55, 62, 48, 48]
}
}When to use
Call at step 7 of the create→curate→optimize loop — after publishing — to evaluate whether the profile is getting traction and which sections are driving clicks or booking intent. Pair with log_curation_decision to record what the creator changed in response to the data.
Gotchas
Watch out
statsisnullfor unpublished profiles — check forslug === ''before interpretingnullas an error.trendPctisnull(not0) whenviewsPrev7dis0; guard againstnullbefore doing arithmetic or displaying a percentage.- This tool uses the uncached
fetchProfileStats— data is live, not the 10-minute cached version the dashboard shows. Repeated calls within seconds are fine but each one hits PostHog. outlineIdis owner-scoped viaresolveOutlineDoc; you cannot query another creator's analytics by passing their ID — it will returnFORBIDDEN.