MCPcopy
hub / github.com/PostHog/posthog / captureTimeToSeeData

Function captureTimeToSeeData

frontend/src/lib/internalMetrics.ts:29–37  ·  view source on GitHub ↗
(teamId: number | null, payload: TimeToSeeDataPayload)

Source from the content-addressed store, hash-verified

27}
28
29export async function captureTimeToSeeData(teamId: number | null, payload: TimeToSeeDataPayload): Promise<void> {
30 if (window.JS_CAPTURE_TIME_TO_SEE_DATA && teamId) {
31 await api.create(`api/projects/${teamId}/insights/timing`, {
32 session_id: currentSessionId(),
33 current_url: window.location.href,
34 ...payload,
35 })
36 }
37}
38
39/** api.get() wrapped in captureTimeToSeeData() tracking for simple cases of fetching insights or dashboards.
40 * This is not in api.ts to avoid circular dependencies, but the principle is the same.

Callers 3

insightLogic.tsFile · 0.90
dashboardLogic.tsxFile · 0.90

Calls 2

currentSessionIdFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…