From a1ae3057119c6c4d55d7f79e48648c667d6e9fd5 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 28 Aug 2023 15:27:52 +0200 Subject: [PATCH] Track snap uninstalls (#20624) * Track snap uninstalls * Change order of execution --- app/scripts/metamask-controller.js | 9 +++++++++ shared/constants/metametrics.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 7c82ee3a8..ba1a8c930 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -2050,6 +2050,15 @@ export default class MetamaskController extends EventEmitter { }, []); this.dismissNotifications(notificationIds); + + this.metaMetricsController.trackEvent({ + event: MetaMetricsEventName.SnapUninstalled, + category: MetaMetricsEventCategory.Snaps, + properties: { + snap_id: truncatedSnap.id, + version: truncatedSnap.version, + }, + }); }, ); diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 666afad59..a6ca40670 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -601,6 +601,7 @@ export enum MetaMetricsEventName { WhatsNewClicked = `What's New Link Clicked`, ///: BEGIN:ONLY_INCLUDE_IN(snaps) SnapInstalled = 'Snap Installed', + SnapUninstalled = 'Snap Uninstalled', SnapUpdated = 'Snap Updated', SnapExportUsed = 'Snap Export Used', ///: END:ONLY_INCLUDE_IN