From acf386c609585a012336c755eef9a9789bc24fb6 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Fri, 1 Sep 2023 13:10:42 +0200 Subject: [PATCH] Fix missing property on snap export metric (#20685) --- app/scripts/metamask-controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 3f10be307..19a7bd5b7 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1855,14 +1855,16 @@ export default class MetamaskController extends EventEmitter { /** * Tracks snaps export usage. Note: This function is throttled to 1 call per 60 seconds. * + * @param {string} snapId - The ID of the snap the handler is being triggered on. * @param {string} handler - The handler to trigger on the snap for the request. */ _trackSnapExportUsage = throttle( - (handler) => + (snapId, handler) => this.metaMetricsController.trackEvent({ event: MetaMetricsEventName.SnapExportUsed, category: MetaMetricsEventCategory.Snaps, properties: { + snap_id: snapId, export: handler, }, }), @@ -1880,7 +1882,7 @@ export default class MetamaskController extends EventEmitter { * @returns The result of the JSON-RPC request. */ handleSnapRequest(args) { - this._trackSnapExportUsage(args.handler); + this._trackSnapExportUsage(args.snapId, args.handler); return this.controllerMessenger.call('SnapController:handleRequest', args); }