From 43a350ad66b38ccee4390851756964ced20926a7 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 10 Oct 2024 12:30:50 +0200 Subject: [PATCH] chore: track project navigation --- .../src/component/personalDashboard/ConnectSDK.tsx | 13 ++++++++++++- .../src/component/personalDashboard/MyProjects.tsx | 9 +++++++++ .../personalDashboard/PersonalDashboard.tsx | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/personalDashboard/ConnectSDK.tsx b/frontend/src/component/personalDashboard/ConnectSDK.tsx index fe5d0b61df61..19fb19b6256a 100644 --- a/frontend/src/component/personalDashboard/ConnectSDK.tsx +++ b/frontend/src/component/personalDashboard/ConnectSDK.tsx @@ -45,6 +45,7 @@ const ActionBox = styled('div')(({ theme }) => ({ })); export const CreateFlag: FC<{ project: string }> = ({ project }) => { + const { trackEvent } = usePlausibleTracker(); return ( @@ -56,7 +57,17 @@ export const CreateFlag: FC<{ project: string }> = ({ project }) => {

Create one to get started.

-
diff --git a/frontend/src/component/personalDashboard/MyProjects.tsx b/frontend/src/component/personalDashboard/MyProjects.tsx index 451fa1b14797..2b66b1065e9d 100644 --- a/frontend/src/component/personalDashboard/MyProjects.tsx +++ b/frontend/src/component/personalDashboard/MyProjects.tsx @@ -30,6 +30,7 @@ import { SpacedGridItem, } from './Grid'; import { ContactAdmins, DataError } from './ProjectDetailsError'; +import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; const ActiveProjectDetails: FC<{ project: PersonalDashboardSchemaProjectsItem; @@ -70,6 +71,7 @@ const ProjectListItem: FC<{ onClick: () => void; }> = ({ project, selected, onClick }) => { const activeProjectRef = useRef(null); + const { trackEvent } = usePlausibleTracker(); useEffect(() => { if (activeProjectRef.current) { @@ -99,6 +101,13 @@ const ProjectListItem: FC<{ href={`projects/${project.id}`} size='small' sx={{ ml: 'auto' }} + onClick={() => { + trackEvent('personal-dashboard', { + props: { + eventType: `Go to project from list`, + }, + }); + }} > diff --git a/frontend/src/component/personalDashboard/PersonalDashboard.tsx b/frontend/src/component/personalDashboard/PersonalDashboard.tsx index 5072b30df2fb..63bfc46d9814 100644 --- a/frontend/src/component/personalDashboard/PersonalDashboard.tsx +++ b/frontend/src/component/personalDashboard/PersonalDashboard.tsx @@ -91,7 +91,7 @@ const FlagListItem: FC<{ onClick={() => { trackEvent('personal-dashboard', { props: { - eventType: `Go to flag`, + eventType: `Go to flag from list`, }, }); }}