Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Track transaction item open events #2602

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/components/transactions/TxDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { DelegateCallWarning, UnsignedWarning } from '@/components/transactions/
import Multisend from '@/components/transactions/TxDetails/TxData/DecodedData/Multisend'
import useSafeInfo from '@/hooks/useSafeInfo'
import useIsPending from '@/hooks/useIsPending'
import { trackEvent, TX_LIST_EVENTS } from '@/services/analytics'

export const NOT_AVAILABLE = 'n/a'

Expand Down Expand Up @@ -126,8 +125,6 @@ const TxDetails = ({

const [txDetailsData, error, loading] = useAsync<TransactionDetails>(
async () => {
trackEvent(TX_LIST_EVENTS.FETCH_DETAILS)

return txDetails || getTransactionDetails(chainId, txSummary.id)
},
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useContext } from 'react'
import { BatchExecuteHoverContext } from '@/components/transactions/BatchExecuteButton/BatchExecuteHoverProvider'
import css from './styles.module.css'
import classNames from 'classnames'
import { trackEvent, TX_LIST_EVENTS } from '@/services/analytics'

type ExpandableTransactionItemProps = {
isGrouped?: boolean
Expand Down Expand Up @@ -37,6 +38,11 @@ export const ExpandableTransactionItem = ({
defaultExpanded={!!txDetails}
className={classNames({ [css.batched]: isBatched })}
data-testid={testId}
onChange={(_, expanded) => {
if (expanded) {
trackEvent(TX_LIST_EVENTS.EXPAND_TRANSACTION)
}
}}
>
<AccordionSummary expandIcon={<ExpandMoreIcon />} sx={{ justifyContent: 'flex-start', overflowX: 'auto' }}>
<TxSummary item={item} isGrouped={isGrouped} />
Expand Down
4 changes: 2 additions & 2 deletions src/services/analytics/events/txList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const TX_LIST_EVENTS = {
action: 'Batch Execute',
category: TX_LIST_CATEGORY,
},
FETCH_DETAILS: {
action: 'Fetch transaction details',
EXPAND_TRANSACTION: {
action: 'Expand transaction item',
category: TX_LIST_CATEGORY,
},
}
Expand Down
Loading