From 4374e536a1c2bd16f5175e25ac5c319d01a881c7 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 8a7b1fff5..03d1e114e 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -2092,6 +2092,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 3b2ed005b..c9d664e3a 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -627,6 +627,7 @@ export enum MetaMetricsEventName { SwapError = 'Swap Error', ///: BEGIN:ONLY_INCLUDE_IN(snaps) SnapInstalled = 'Snap Installed', + SnapUninstalled = 'Snap Uninstalled', SnapUpdated = 'Snap Updated', SnapExportUsed = 'Snap Export Used', ///: END:ONLY_INCLUDE_IN