mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* 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>
20 lines
643 B
TypeScript
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,
|
|
});
|
|
}
|