diff --git a/src/components/common/NetworkSelector/index.tsx b/src/components/common/NetworkSelector/index.tsx index 962fd4a7bc..e3775772a2 100644 --- a/src/components/common/NetworkSelector/index.tsx +++ b/src/components/common/NetworkSelector/index.tsx @@ -26,7 +26,7 @@ import { useRouter } from 'next/router' import css from './styles.module.css' import { useChainId } from '@/hooks/useChainId' import { type ReactElement, useCallback, useMemo, useState } from 'react' -import { OVERVIEW_EVENTS, OVERVIEW_LABELS } from '@/services/analytics' +import { OVERVIEW_EVENTS, OVERVIEW_LABELS, trackEvent } from '@/services/analytics' import { useAllSafesGrouped } from '@/components/welcome/MyAccounts/useAllSafesGrouped' import useSafeAddress from '@/hooks/useSafeAddress' @@ -327,12 +327,17 @@ const NetworkSelector = ({ const chain = chains.data.find((chain) => chain.chainId === chainId) if (!chain) return null + const onSwitchNetwork = () => { + trackEvent({ ...OVERVIEW_EVENTS.SWITCH_NETWORK, label: chainId }) + } + return ( { setOpen(true) + offerSafeCreation && trackEvent({ ...OVERVIEW_EVENTS.EXPAND_MULTI_SAFE, label: OVERVIEW_LABELS.top_bar }) } return configs.length ? ( diff --git a/src/features/multichain/components/CreateSafeOnNewChain/index.tsx b/src/features/multichain/components/CreateSafeOnNewChain/index.tsx index 894c00c8d6..a4b276ac5e 100644 --- a/src/features/multichain/components/CreateSafeOnNewChain/index.tsx +++ b/src/features/multichain/components/CreateSafeOnNewChain/index.tsx @@ -1,7 +1,7 @@ import ModalDialog from '@/components/common/ModalDialog' import NetworkInput from '@/components/common/NetworkInput' import ErrorMessage from '@/components/tx/ErrorMessage' -import { OVERVIEW_EVENTS, trackEvent } from '@/services/analytics' +import { CREATE_SAFE_CATEGORY, CREATE_SAFE_EVENTS, OVERVIEW_EVENTS, trackEvent } from '@/services/analytics' import { showNotification } from '@/store/notificationsSlice' import { Box, Button, CircularProgress, DialogActions, DialogContent, Stack, Typography } from '@mui/material' import { FormProvider, useForm } from 'react-hook-form' @@ -95,7 +95,7 @@ const ReplaySafeDialog = ({ return } - trackEvent({ ...OVERVIEW_EVENTS.SUBMIT_ADD_NEW_NETWORK, label: selectedChain.chainName }) + trackEvent({ ...OVERVIEW_EVENTS.SUBMIT_ADD_NEW_NETWORK, label: selectedChain.chainId }) // 2. Replay Safe creation and add it to the counterfactual Safes replayCounterfactualSafeDeployment( @@ -107,6 +107,9 @@ const ReplaySafeDialog = ({ PayMethod.PayLater, ) + trackEvent({ ...OVERVIEW_EVENTS.PROCEED_WITH_TX, label: 'counterfactual', category: CREATE_SAFE_CATEGORY }) + trackEvent({ ...CREATE_SAFE_EVENTS.CREATED_SAFE, label: 'counterfactual' }) + router.push({ query: { safe: `${selectedChain.shortName}:${safeAddress}`,