diff --git a/public/app/features/dashboard/components/ShareModal/ShareLink.tsx b/public/app/features/dashboard/components/ShareModal/ShareLink.tsx index c2a8c5968f4..0c6ad6c77e0 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareLink.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareLink.tsx @@ -30,6 +30,7 @@ export class ShareLink extends PureComponent { shareUrl: '', imageUrl: '', }; + this.onCopy = this.onCopy.bind(this); } componentDidMount() { @@ -74,7 +75,11 @@ export class ShareLink extends PureComponent { }; onCopy() { - trackDashboardSharingActionPerType('copy_link', shareDashboardType.link); + trackDashboardSharingActionPerType('copy_link', shareDashboardType.link, { + currentTimeRange: this.state.useCurrentTimeRange, + theme: this.state.selectedTheme, + shortenURL: this.state.useShortUrl, + }); } render() { diff --git a/public/app/features/dashboard/components/ShareModal/analytics.ts b/public/app/features/dashboard/components/ShareModal/analytics.ts index 7e27925215e..3e84825a784 100644 --- a/public/app/features/dashboard/components/ShareModal/analytics.ts +++ b/public/app/features/dashboard/components/ShareModal/analytics.ts @@ -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 +) { reportInteraction(shareAnalyticsEventNames.sharingActionClicked, { item: action, sharing_category: sharingType, + ...options, }); }