From 9a4938ea5efc552afe2ffa574f5231432be44591 Mon Sep 17 00:00:00 2001 From: JPSchellenberg Date: Sat, 22 Feb 2020 22:41:37 +0100 Subject: [PATCH] fix(tracking): track client-side actions --- src/client/boot/index.tsx | 3 - src/client/lib/components/AppBar.tsx | 9 +- src/client/lib/components/EditorStartPage.tsx | 16 +- src/client/lib/components/LeftDrawer.tsx | 9 +- src/client/lib/track/actions.ts | 29 +- src/client/lib/track/api.ts | 15 + src/client/public/index.html | 1548 +++++++++-------- src/client/state/editor/actions.ts | 13 +- src/client/views/FileTree.tsx | 3 + src/client/views/Root.tsx | 12 - src/client/views/Tab.tsx | 3 + src/client/views/Tabs.tsx | 3 + src/menu.ts | 9 + src/server/routes/index.ts | 3 + src/server/routes/track.ts | 19 + src/updater.ts | 3 + 16 files changed, 900 insertions(+), 797 deletions(-) create mode 100644 src/client/lib/track/api.ts create mode 100644 src/server/routes/track.ts diff --git a/src/client/boot/index.tsx b/src/client/boot/index.tsx index bc1b4e153..e1b615449 100644 --- a/src/client/boot/index.tsx +++ b/src/client/boot/index.tsx @@ -21,13 +21,10 @@ import App from '../views'; import SnackbarProvider from '../theme/Snackbar'; -import { track } from 'lib/track/actions'; - const log = new Logger('root'); log.info(`booting v${process.env.VERSION}`); Sentry.captureMessage('start'); -track('start'); declare var window: any; diff --git a/src/client/lib/components/AppBar.tsx b/src/client/lib/components/AppBar.tsx index de6f6b6bc..336fdb794 100644 --- a/src/client/lib/components/AppBar.tsx +++ b/src/client/lib/components/AppBar.tsx @@ -14,6 +14,8 @@ import MenuIcon from '@material-ui/icons/Menu'; import { drawerWidth } from '../../theme'; +import { track } from 'lib/track/actions'; + export default function AppBar(props: { leftDrawerOpen: boolean; openLeftDrawer?: () => void; @@ -32,7 +34,12 @@ export default function AppBar(props: { { + track('app_bar', 'click', 'menu_icon'); + if (openLeftDrawer) { + openLeftDrawer(); + } + }} edge="start" className={clsx( classes.menuButton, diff --git a/src/client/lib/components/EditorStartPage.tsx b/src/client/lib/components/EditorStartPage.tsx index d4e4a7d9c..a4fb2836d 100644 --- a/src/client/lib/components/EditorStartPage.tsx +++ b/src/client/lib/components/EditorStartPage.tsx @@ -6,6 +6,8 @@ import Grid from '@material-ui/core/Grid'; import { makeStyles, Theme } from '@material-ui/core/styles'; import Typography from '@material-ui/core/Typography'; +import { track } from 'lib/track/actions'; + export default function EditorStartPage(props: { primaryButtonClick: () => void; secondaryButtonClick: () => void; @@ -36,7 +38,10 @@ export default function EditorStartPage(props: {