Skip to content

Commit

Permalink
Track linode label update on details page and settings tab
Browse files Browse the repository at this point in the history
  • Loading branch information
mjac0bs committed Feb 13, 2024
1 parent 2f0ae2b commit a8cee99
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
useLinodeQuery,
useLinodeUpdateMutation,
} from 'src/queries/linodes/linodes';
import { sendUpdateLinodeLabelEvent } from 'src/utilities/analytics';
import { getErrorMap } from 'src/utilities/errorUtils';

interface Props {
Expand Down Expand Up @@ -40,6 +41,7 @@ export const LinodeSettingsLabelPanel = (props: Props) => {
enqueueSnackbar(`Successfully updated Linode label to ${label}`, {
variant: 'success',
});
sendUpdateLinodeLabelEvent('Settings');
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { isFeatureEnabled } from 'src/utilities/accountCapabilities';
import {
sendEditBreadcrumbEvent,
sendLinodeCreateFlowDocsClickEvent,
sendUpdateLinodeLabelEvent,
} from 'src/utilities/analytics';
import { getAPIErrorOrDefault } from 'src/utilities/errorUtils';
import { getQueryParamsFromQueryString } from 'src/utilities/queryParams';
Expand Down Expand Up @@ -163,6 +164,7 @@ const LinodeDetailHeader = () => {
return updateLinodeLabel(label)
.then(() => {
resetEditableLabel();
sendUpdateLinodeLabelEvent('Breadcrumb');
})
.catch((updateError) => {
const errorReasons: string[] = [updateError.message];
Expand Down
12 changes: 12 additions & 0 deletions packages/manager/src/utilities/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,15 @@ export const sendEditBreadcrumbEvent = () => {
label: 'Edit Breadcrumb',
});
};

// LinodeDetailHeader.tsx
// LinodeSettingsLabelPanel.tsx
export const sendUpdateLinodeLabelEvent = (
label: 'Breadcrumb' | 'Settings'
) => {
sendEvent({
action: 'Click:button',
category: 'Linode Label',
label: `Update linode label from ${label}`,
});
};

0 comments on commit a8cee99

Please sign in to comment.