Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(onboarding): add PH button capture for 'try demo project' (#13251)

annabellschad205b39edf92
diff --git a/web/src/features/organizations/components/ProjectOverview.tsx b/web/src/features/organizations/components/ProjectOverview.tsx
index 67da727c7d..c8c4d3f714 100644
--- a/web/src/features/organizations/components/ProjectOverview.tsx
+++ b/web/src/features/organizations/components/ProjectOverview.tsx
@@ -32,6 +32,7 @@ import {
import { isCloudPlan, planLabels } from "@langfuse/shared";
import ContainerPage from "@/src/components/layouts/container-page";
import { type User } from "next-auth";
+import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
const OrganizationProjectTiles = ({
org,
@@ -76,6 +77,8 @@ const OrganizationProjectTiles = ({
};
const DemoOrganizationTile = () => {
+ const capture = usePostHogClientCapture();
+
return (
<Card>
<CardHeader>
@@ -87,7 +90,14 @@ const DemoOrganizationTile = () => {
</CardContent>
<CardFooter>
<Button asChild variant="secondary">
- <Link href={`/project/${env.NEXT_PUBLIC_DEMO_PROJECT_ID}/traces`}>
+ <Link
+ href={`/project/${env.NEXT_PUBLIC_DEMO_PROJECT_ID}/traces`}
+ onClick={() =>
+ capture("organizations:demo_project_button_click", {
+ location: "project_overview_demo_tile",
+ })
+ }
+ >
View Demo Project
</Link>
</Button>
diff --git a/web/src/features/posthog-analytics/usePostHogClientCapture.ts b/web/src/features/posthog-analytics/usePostHogClientCapture.ts
index 9eac9387c9..01d3e11f08 100644
--- a/web/src/features/posthog-analytics/usePostHogClientCapture.ts
+++ b/web/src/features/posthog-analytics/usePostHogClientCapture.ts
@@ -131,13 +131,16 @@ export const events = {
"delete_form_open",
"delete_dataset_button_click",
"update_form_open",
- "delete_form_open",
"new_form_open",
"new_form_submit",
"update_form_submit",
"delete_form_submit",
],
- organizations: ["new_form_submit", "new_form_open"],
+ organizations: [
+ "new_form_submit",
+ "new_form_open",
+ "demo_project_button_click",
+ ],
projects: ["new_form_submit", "new_form_open"],
dataset_item: [
"archive_toggle",