Files
grafana/public/app/features/dashboard/components/ShareModal/analytics.ts
Polina Boneva c5b399dc99 Dashboard: Add analytics events for sharing a dashboard (#72613)
* activeTab for public dashboard matches others

* add analytics action for going through categories of sharing modal

* add analytics for going through actions of any cateogry in sharing modal

* change 'tab' to 'category'; add key 'sharing_category' to actions for easier distinction

* sharedCategory sounds like a category is shared; changed naming to shareDashboardType

* remove hard-coded analytic event name

* wrap the reportInteraction call for all actions when sharing dashboard

---------

Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
2023-08-03 16:41:26 +03:00

20 lines
643 B
TypeScript

import { reportInteraction } from '@grafana/runtime';
export const shareAnalyticsEventNames: {
[key: string]: string;
} = {
sharingCategoryClicked: 'dashboards_sharing_category_clicked',
sharingActionClicked: 'dashboards_sharing_actions_clicked',
};
export function trackDashboardSharingTypeOpen(sharingType: string) {
reportInteraction(shareAnalyticsEventNames.sharingCategoryClicked, { item: sharingType });
}
export function trackDashboardSharingActionPerType(action: string, sharingType: string) {
reportInteraction(shareAnalyticsEventNames.sharingActionClicked, {
item: action,
sharing_category: sharingType,
});
}