diff options
| author | Mahesh Sanikommmu <[email protected]> | 2025-08-16 18:50:10 -0700 |
|---|---|---|
| committer | Mahesh Sanikommmu <[email protected]> | 2025-08-16 18:50:10 -0700 |
| commit | 39003aff23d64ff1d96074d71521f6023c9bec01 (patch) | |
| tree | 3f870c04b3dce315bba1b21aa2da158494e71774 /apps/web/lib/analytics.ts | |
| parent | Merge pull request #355 from supermemoryai/archive (diff) | |
| download | supermemory-39003aff23d64ff1d96074d71521f6023c9bec01.tar.xz supermemory-39003aff23d64ff1d96074d71521f6023c9bec01.zip | |
New Version of Supermemory Consumer App
Diffstat (limited to 'apps/web/lib/analytics.ts')
| -rw-r--r-- | apps/web/lib/analytics.ts | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/web/lib/analytics.ts b/apps/web/lib/analytics.ts new file mode 100644 index 00000000..21fec3ea --- /dev/null +++ b/apps/web/lib/analytics.ts @@ -0,0 +1,44 @@ +import posthog from "posthog-js" + +export const analytics = { + userSignedOut: () => posthog.capture("user_signed_out"), + tourStarted: () => posthog.capture("tour_started"), + tourCompleted: () => posthog.capture("tour_completed"), + tourSkipped: () => posthog.capture("tour_skipped"), + + memoryAdded: (props: { + type: "note" | "link" | "file" + project_id?: string + content_length?: number + file_size?: number + file_type?: string + }) => posthog.capture("memory_added", props), + + memoryDetailOpened: () => posthog.capture("memory_detail_opened"), + + projectCreated: () => posthog.capture("project_created"), + + newChatStarted: () => posthog.capture("new_chat_started"), + chatHistoryViewed: () => posthog.capture("chat_history_viewed"), + chatDeleted: () => posthog.capture("chat_deleted"), + + viewModeChanged: (mode: "graph" | "list") => + posthog.capture("view_mode_changed", { mode }), + + documentCardClicked: () => posthog.capture("document_card_clicked"), + + billingViewed: () => posthog.capture("billing_viewed"), + upgradeInitiated: () => posthog.capture("upgrade_initiated"), + upgradeCompleted: () => posthog.capture("upgrade_completed"), + billingPortalOpened: () => posthog.capture("billing_portal_opened"), + + connectionAdded: (provider: string) => + posthog.capture("connection_added", { provider }), + connectionDeleted: () => posthog.capture("connection_deleted"), + connectionAuthStarted: () => posthog.capture("connection_auth_started"), + connectionAuthCompleted: () => posthog.capture("connection_auth_completed"), + connectionAuthFailed: () => posthog.capture("connection_auth_failed"), + + mcpViewOpened: () => posthog.capture("mcp_view_opened"), + mcpInstallCmdCopied: () => posthog.capture("mcp_install_cmd_copied"), +}
\ No newline at end of file |