diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/LinodeSettingsLabelPanel.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/LinodeSettingsLabelPanel.tsx index 8cb165353ad..a75fd776252 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/LinodeSettingsLabelPanel.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeSettings/LinodeSettingsLabelPanel.tsx @@ -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 { @@ -40,6 +41,7 @@ export const LinodeSettingsLabelPanel = (props: Props) => { enqueueSnackbar(`Successfully updated Linode label to ${label}`, { variant: 'success', }); + sendUpdateLinodeLabelEvent('Settings'); }, }); diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx index ca235983212..7c9a0087519 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodesDetailHeader/LinodeDetailHeader.tsx @@ -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'; @@ -163,6 +164,7 @@ const LinodeDetailHeader = () => { return updateLinodeLabel(label) .then(() => { resetEditableLabel(); + sendUpdateLinodeLabelEvent('Breadcrumb'); }) .catch((updateError) => { const errorReasons: string[] = [updateError.message]; diff --git a/packages/manager/src/utilities/analytics.ts b/packages/manager/src/utilities/analytics.ts index 546e34e039c..cb1b0bebd4b 100644 --- a/packages/manager/src/utilities/analytics.ts +++ b/packages/manager/src/utilities/analytics.ts @@ -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}`, + }); +};