Chore: track share link options (#77240)

pull/77395/head
Ezequiel Victorero 2 years ago committed by GitHub
parent e4d1fdc3d0
commit 468d000979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      public/app/features/dashboard/components/ShareModal/ShareLink.tsx
  2. 7
      public/app/features/dashboard/components/ShareModal/analytics.ts

@ -30,6 +30,7 @@ export class ShareLink extends PureComponent<Props, State> {
shareUrl: '',
imageUrl: '',
};
this.onCopy = this.onCopy.bind(this);
}
componentDidMount() {
@ -74,7 +75,11 @@ export class ShareLink extends PureComponent<Props, State> {
};
onCopy() {
trackDashboardSharingActionPerType('copy_link', shareDashboardType.link);
trackDashboardSharingActionPerType('copy_link', shareDashboardType.link, {
currentTimeRange: this.state.useCurrentTimeRange,
theme: this.state.selectedTheme,
shortenURL: this.state.useShortUrl,
});
}
render() {

@ -11,9 +11,14 @@ export function trackDashboardSharingTypeOpen(sharingType: string) {
reportInteraction(shareAnalyticsEventNames.sharingCategoryClicked, { item: sharingType });
}
export function trackDashboardSharingActionPerType(action: string, sharingType: string) {
export function trackDashboardSharingActionPerType(
action: string,
sharingType: string,
options?: Record<string, unknown>
) {
reportInteraction(shareAnalyticsEventNames.sharingActionClicked, {
item: action,
sharing_category: sharingType,
...options,
});
}

Loading…
Cancel
Save