Developer guide: 14. Web analytics, live view and Replay Vision
Web analytics reports, the live view and Replay Vision over the API.
14. Web analytics, live view and Replay Vision
Web analytics is the traffic view: visitors, sessions, pages, referrers, channels, goals, attribution and revenue. It is computed from $pageview events and the properties below. All routes are GET {p}/web/... with insight:read unless stated; writes need insight:write.
What the events must carry, or reports stay empty:
$pageviewwith$host,$pathname(or$current_url),$referrer, and$session_idto group pageviews into one session. UTM keys:$utm_source,$utm_medium,$utm_campaign,$utm_term,$utm_content. The SDKs set all of these.A browser
User-Agent. Events sent by plaincurlcarry$bot_name: curland are classified as bot traffic, which web reports exclude. When you test withcurl, add-A "Mozilla/5.0 ... Chrome/130.0.0.0 Safari/537.36".GET {p}/live/botsshows what was classified as a bot.Reports lag capture by seconds.
UA='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36'
curl -sS -A "$UA" -X POST "$LUCIDA_CAPTURE/v1/batch" -H "Content-Type: application/json" -d '{"api_key":"'"$PK"'","batch":[{
"uuid":"'"$(uuidgen | tr A-Z a-z)"'","event":"$pageview","distinct_id":"vis_1","properties":{
"$current_url":"https://acme.test/pricing","$host":"acme.test","$pathname":"/pricing",
"$referrer":"https://www.google.com/","$session_id":"'"$(uuidgen | tr A-Z a-z)"'","$utm_medium":"email"}}]}'14.1 Overview, breakdown, realtime
lc "$LUCIDA_API/v1/projects/$PROJECT_ID/web/overview?from=2026-11-01T00:00:00Z&to=2026-11-10T00:00:00Z" | jq '{current,delta}'
lc "$LUCIDA_API/v1/projects/$PROJECT_ID/web/breakdown?dimension=channel&limit=10" | jq '.[] | {key,visitors,sessions}'
lc "$LUCIDA_API/v1/projects/$PROJECT_ID/web/realtime" # {visitors, pageviews, by_country:[{key,visitors}]} last 30 minutesRoute | Query | Returns |
|---|---|---|
|
|
|
|
| array of |
| none | visitors and pageviews in the last 30 minutes |
Default range is the last 30 days. from and to must be RFC 3339. host keeps one hostname. properties is a property-group JSON (only sessions with a matching event). dims is JSON {"channel":"Email","country":"DE"} for click-to-filter (at most 8).
Exact dimension values (singular; pages is 400 and the answer lists these):
page, entry_page, exit_page, referrer, channel, utm_source, utm_medium, utm_campaign, utm_term, utm_content, country, region, city, device, browser, os, host, language, resolution, browser_version, os_version, device_brand, device_model, visitor, visit_number, hour, weekday, timezone.
Channel values are labels such as Organic Search, Email, Organic Social, Direct, Referral, Paid Search, Paid AI/AI Referral. Override them with channel rules (14.5).
14.2 Goals
A goal turns a pageview or event into a conversion. Goals feed the overview chart and attribution (goal_id).
lc -X POST "$LUCIDA_API/v1/projects/$PROJECT_ID/web/goals" -d '{"name":"Reached signup","kind":"pageview","target":"/signup"}'
lc -X POST "$LUCIDA_API/v1/projects/$PROJECT_ID/web/goals" -d '{"name":"Purchase","kind":"event","target":"purchase","value_property":"amount"}'
lc "$LUCIDA_API/v1/projects/$PROJECT_ID/web/goals/report" | jq '.[] | {name:.goal.name,conversions,converters,conversion_rate}'Route | Purpose |
|---|---|
|
|
|
|
| remove |
|
|
| daily |
| suggested goals by UTM coverage |
14.3 Attribution, spend, revenue
Route | Notes |
|---|---|
| exactly one of |
| touchpoint sequences; adds |
| how recent sessions were classified ( |
| spend joined to sessions: pass exactly one of |
| body |
| response curves; scenario body |
| campaigns without spend, spend without sessions, unmapped paid sources |
| one device seen as several persons |
| revenue from |
| event and property names (defaults |
| FX rates ( |
14.4 Content, audience and other reports
All take from, to unless noted; most take limit.
Route | What it shows |
|---|---|
| content blocks; |
| time on page, exits after site search, Search Console and Bing data |
| weekday by hour grid |
| pageviews grouped by a custom dimension |
| AI crawlers, AI-search referrals, citations, share of voice |
| status classes and 404/5xx paths from |
| summary object; narrative text (needs a configured AI provider; without one it answers |
| one view over several projects of an org (session only; |
| status and manual refresh of daily rollup tiles |
14.5 Settings and configuration
lc -X PUT "$LUCIDA_API/v1/projects/$PROJECT_ID/web/settings" -d '{"bounce_threshold_s":10,"referrer_exclusions":["checkout.acme.com"]}'PUT web/settings (insight:write) accepts: bounce_threshold_s (0 to 3600), bounce_ignores_interactions, referrer_exclusions[] (own domains shown as direct), host_allowlist[] (only these hosts are reported), campaign_match, utm_campaign_map, utm_source_allowlist, precompute, marketing_cards, marketing_onboarded, spend_tables[]. Unknown fields are rejected; the answer is the stored object.
Route | Body and purpose |
|---|---|
|
|
| custom dimension |
| drop events at the gateway before counting: |
|
|
| public web dashboard link (body as in 13.5). Public: |
| body |
| hide internal traffic from reports: |
14.6 Live view
Route | Purpose |
|---|---|
|
|
| server-sent events of the same |
| server-sent event stream of incoming events; keep the connection open, do not use it in a request/response script |
| bot requests per minute and by crawler name, category, share |
14.7 Replay Vision
Vision asks one saved question of session transcripts (text, never video) using an LLM, and records an answer per replay. Use it to find "which sessions show confusion about pricing" without watching them. Scans cost money against the project's AI budget; use estimate first, and a monthly_cap_usd.
Scanner kind is monitor (yes or no verdict), classifier (pick categories), scorer (a number) or summarizer. model is claude-haiku-5-5 (about 0.002 USD per observation) or claude-opus-5-5 (about 0.08).
lc -X POST "$LUCIDA_API/v1/projects/$PROJECT_ID/vision/estimate" -d '{"filters":{"url_visited":"/pricing"},"coverage":"all","sample_rate":0.1,"model":"claude-haiku-5-5"}'
# {"matching_7d":1,"eligible_7d":0,"projected_monthly_observations":0.0,"per_observation_usd":0.002,"projected_monthly_usd":0.0,"capped":false}
lc -X POST "$LUCIDA_API/v1/projects/$PROJECT_ID/vision/scanners" -d '{
"name":"Pricing confusion","kind":"monitor","prompt":"Did the visitor seem confused about the plan prices?",
"filters":{"url_visited":"/pricing"},"coverage":"all","sample_rate":0.1,
"model":"claude-haiku-5-5","monthly_cap_usd":5,"enabled":false}' | jq '{id,version}'Scanner body: name, kind, prompt (1 to 4000 characters) required; description, tags[], config, filters (a replays/search body without date_range, limit, cursor, order_by, direction, hide_viewed, collection), coverage (high, medium, all, default all), sample_rate (0.001 to 1), model, monthly_cap_usd, monthly_max_observations, enabled (default true). config by kind: classifier {categories[] (max 30, 1 to 40 chars), multi, freeform} and needs categories or freeform:true; scorer {min, max, label} with min < max; summarizer {length:"short"|"medium"|"long", context}; any kind learned_rules[] (max 10).
Route | Scope | Purpose |
|---|---|---|
| read / write | scanners. |
| read | monthly volume and cost estimate |
| write |
|
| write / read |
|
| write | backfill past recordings |
| read | filters |
| read / write | one observation; rate |
| read | lexical search of answers ( |
| read | what to watch: observations ranked by notability ( |
| read | health, how answers relate to duration and frustration, answers per experiment variant |
|
|
|
| write | proposes rules from ratings; saves nothing |
| read | this month's spend, daily series, per scanner, projection |
| read / write |
|