diff --git a/packages/extension/src/libs/metrics/types.ts b/packages/extension/src/libs/metrics/types.ts index fa97e8449..16ba765b8 100644 --- a/packages/extension/src/libs/metrics/types.ts +++ b/packages/extension/src/libs/metrics/types.ts @@ -4,6 +4,8 @@ export enum SwapEventType { SwapVerify = "swap_verify", SwapComplete = "swap_complete", swapFailed = "swap_failed", + swapCancelled = "swap_cancelled", + swapBack = "swap_back", } export enum NetworkChangeEvents { diff --git a/packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue b/packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue index 4ebc2592d..484cda6c5 100644 --- a/packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue +++ b/packages/extension/src/providers/bitcoin/ui/btc-verify-transaction.vue @@ -122,7 +122,7 @@ import CommonPopup from "@action/views/common-popup/index.vue"; import SendFeeSelect from "@/providers/common/ui/send-transaction/send-fee-select.vue"; import HardwareWalletMsg from "@/providers/common/ui/verify-transaction/hardware-wallet-msg.vue"; import AlertIcon from "@action/icons/send/alert-icon.vue"; -import { getCustomError, getError } from "@/libs/error"; +import { getError } from "@/libs/error"; import { ErrorCodes } from "@/providers/ethereum/types"; import { WindowPromiseHandler } from "@/libs/window-promise"; import { DEFAULT_BTC_NETWORK, getNetworkByName } from "@/libs/utils/networks"; diff --git a/packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue b/packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue index 76b12a563..34c044a8c 100644 --- a/packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue +++ b/packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue @@ -311,6 +311,12 @@ onMounted(async () => { }); const back = () => { + trackSwapEvents(SwapEventType.swapBack, { + network: network.value!.name, + fromToken: swapData.fromToken.name, + toToken: swapData.toToken.name, + swapProvider: pickedTrade.value.provider, + }); if (!isWindowPopup.value) { router.go(-1); } else { @@ -319,6 +325,12 @@ const back = () => { }; const close = () => { + trackSwapEvents(SwapEventType.swapCancelled, { + network: network.value!.name, + fromToken: swapData.fromToken.name, + toToken: swapData.toToken.name, + swapProvider: pickedTrade.value.provider, + }); if (!isWindowPopup.value) { router.go(-2); } else {