Chore: track share link options (#77240)

This commit is contained in:
Ezequiel Victorero 2023-10-30 15:14:54 -03:00 committed by GitHub
parent e4d1fdc3d0
commit 468d000979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -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() {

View File

@ -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,
});
}