From 682a4073b4428f3bd1a4c91267e6af83467496b6 Mon Sep 17 00:00:00 2001 From: Juan Cabanas Date: Wed, 25 Sep 2024 16:03:30 +0200 Subject: [PATCH] ShareDrawer: Add share button tracking (#93742) --- .../dashboard-scene/sharing/ShareButton/ShareButton.tsx | 3 ++- public/app/features/dashboard-scene/utils/interactions.ts | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/ShareButton.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/ShareButton.tsx index 0d8363c9d1b..f5574ea89f9 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/ShareButton.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/ShareButton.tsx @@ -18,12 +18,13 @@ export default function ShareButton({ dashboard, panel }: { dashboard: Dashboard const [isOpen, setIsOpen] = useState(false); const [_, buildUrl] = useAsyncFn(async () => { + DashboardInteractions.toolbarShareClick(); return await buildShareUrl(dashboard, panel); }, [dashboard]); const onMenuClick = useCallback((isOpen: boolean) => { if (isOpen) { - DashboardInteractions.toolbarShareClick(); + DashboardInteractions.toolbarShareDropdownClick(); } setIsOpen(isOpen); diff --git a/public/app/features/dashboard-scene/utils/interactions.ts b/public/app/features/dashboard-scene/utils/interactions.ts index fef5f346551..6ed95fe6cb8 100644 --- a/public/app/features/dashboard-scene/utils/interactions.ts +++ b/public/app/features/dashboard-scene/utils/interactions.ts @@ -28,6 +28,9 @@ export const DashboardInteractions = { toolbarShareClick: () => { reportDashboardInteraction('toolbar_actions_clicked', { item: 'share' }); }, + toolbarShareDropdownClick: () => { + reportDashboardInteraction('toolbar_actions_clicked', { item: 'share_dropdown' }); + }, toolbarAddClick: () => { reportDashboardInteraction('toolbar_actions_clicked', { item: 'add' }); },