Commit bb1db904 authored by Adrian Kant's avatar Adrian Kant Committed by GitHub

refactor: using more specific analytics names (#5505)

* using new events library

* use not found page name constant

* use 2.0

* fix

* latest package including commonJS

* update to latest version
parent 20dbb2a9
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SharedEventName } from '@uniswap/analytics-events'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { useIsDarkMode } from 'state/user/hooks' import { useIsDarkMode } from 'state/user/hooks'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
...@@ -123,7 +123,11 @@ const LogoSectionContent = () => { ...@@ -123,7 +123,11 @@ const LogoSectionContent = () => {
<SocialLink href="https://github.com/Uniswap" target="_blank" rel="noopener noreferrer"> <SocialLink href="https://github.com/Uniswap" target="_blank" rel="noopener noreferrer">
<DiscordIcon size={32} /> <DiscordIcon size={32} />
</SocialLink> </SocialLink>
<TraceEvent events={[BrowserEvent.onClick]} name={EventName.ELEMENT_CLICKED} element={ElementName.TWITTER_LINK}> <TraceEvent
events={[BrowserEvent.onClick]}
name={SharedEventName.ELEMENT_CLICKED}
element={InterfaceElementName.TWITTER_LINK}
>
<SocialLink href="https://twitter.com/uniswap" target="_blank" rel="noopener noreferrer"> <SocialLink href="https://twitter.com/uniswap" target="_blank" rel="noopener noreferrer">
<TwitterIcon size={32} /> <TwitterIcon size={32} />
</SocialLink> </SocialLink>
......
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, EventName } from '@uniswap/analytics-events' import { BrowserEvent, SharedEventName } from '@uniswap/analytics-events'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { useIsDarkMode } from 'state/user/hooks' import { useIsDarkMode } from 'state/user/hooks'
import styled, { DefaultTheme } from 'styled-components/macro' import styled, { DefaultTheme } from 'styled-components/macro'
...@@ -123,7 +123,7 @@ const Card = ({ ...@@ -123,7 +123,7 @@ const Card = ({
}) => { }) => {
const isDarkMode = useIsDarkMode() const isDarkMode = useIsDarkMode()
return ( return (
<TraceEvent events={[BrowserEvent.onClick]} name={EventName.ELEMENT_CLICKED} element={elementName}> <TraceEvent events={[BrowserEvent.onClick]} name={SharedEventName.ELEMENT_CLICKED} element={elementName}>
<StyledCard <StyledCard
type={type} type={type}
as={external ? 'a' : Link} as={external ? 'a' : Link}
......
import { ElementName } from '@uniswap/analytics-events' import { InterfaceElementName } from '@uniswap/analytics-events'
import { DollarSign, Terminal } from 'react-feather' import { DollarSign, Terminal } from 'react-feather'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { lightTheme } from 'theme/colors' import { lightTheme } from 'theme/colors'
...@@ -18,7 +18,7 @@ export const MAIN_CARDS = [ ...@@ -18,7 +18,7 @@ export const MAIN_CARDS = [
cta: 'Trade Tokens', cta: 'Trade Tokens',
darkBackgroundImgSrc: swapCardImgSrc, darkBackgroundImgSrc: swapCardImgSrc,
lightBackgroundImgSrc: swapCardImgSrc, lightBackgroundImgSrc: swapCardImgSrc,
elementName: ElementName.ABOUT_PAGE_SWAP_CARD, elementName: InterfaceElementName.ABOUT_PAGE_SWAP_CARD,
}, },
{ {
to: '/nfts', to: '/nfts',
...@@ -27,7 +27,7 @@ export const MAIN_CARDS = [ ...@@ -27,7 +27,7 @@ export const MAIN_CARDS = [
cta: 'Explore NFTs', cta: 'Explore NFTs',
darkBackgroundImgSrc: nftCardImgSrc, darkBackgroundImgSrc: nftCardImgSrc,
lightBackgroundImgSrc: nftCardImgSrc, lightBackgroundImgSrc: nftCardImgSrc,
elementName: ElementName.ABOUT_PAGE_NFTS_CARD, elementName: InterfaceElementName.ABOUT_PAGE_NFTS_CARD,
}, },
] ]
...@@ -47,7 +47,7 @@ export const MORE_CARDS = [ ...@@ -47,7 +47,7 @@ export const MORE_CARDS = [
lightIcon: <DollarSign color={lightTheme.textTertiary} size={48} />, lightIcon: <DollarSign color={lightTheme.textTertiary} size={48} />,
darkIcon: <StyledCardLogo src={darkDollarImgSrc} alt="Earn" />, darkIcon: <StyledCardLogo src={darkDollarImgSrc} alt="Earn" />,
cta: 'Buy now', cta: 'Buy now',
elementName: ElementName.ABOUT_PAGE_BUY_CRYPTO_CARD, elementName: InterfaceElementName.ABOUT_PAGE_BUY_CRYPTO_CARD,
}, },
{ {
to: '/pool', to: '/pool',
...@@ -56,7 +56,7 @@ export const MORE_CARDS = [ ...@@ -56,7 +56,7 @@ export const MORE_CARDS = [
lightIcon: <StyledCardLogo src={lightArrowImgSrc} alt="Analytics" />, lightIcon: <StyledCardLogo src={lightArrowImgSrc} alt="Analytics" />,
darkIcon: <StyledCardLogo src={darkArrowImgSrc} alt="Analytics" />, darkIcon: <StyledCardLogo src={darkArrowImgSrc} alt="Analytics" />,
cta: 'Provide liquidity', cta: 'Provide liquidity',
elementName: ElementName.ABOUT_PAGE_EARN_CARD, elementName: InterfaceElementName.ABOUT_PAGE_EARN_CARD,
}, },
{ {
to: 'https://docs.uniswap.org', to: 'https://docs.uniswap.org',
...@@ -66,6 +66,6 @@ export const MORE_CARDS = [ ...@@ -66,6 +66,6 @@ export const MORE_CARDS = [
lightIcon: <Terminal color={lightTheme.textTertiary} size={48} />, lightIcon: <Terminal color={lightTheme.textTertiary} size={48} />,
darkIcon: <StyledCardLogo src={darkTerminalImgSrc} alt="Developers" />, darkIcon: <StyledCardLogo src={darkTerminalImgSrc} alt="Developers" />,
cta: 'Developer docs', cta: 'Developer docs',
elementName: ElementName.ABOUT_PAGE_DEV_DOCS_CARD, elementName: InterfaceElementName.ABOUT_PAGE_DEV_DOCS_CARD,
}, },
] ]
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
...@@ -332,8 +332,8 @@ export default function SwapCurrencyInputPanel({ ...@@ -332,8 +332,8 @@ export default function SwapCurrencyInputPanel({
{showMaxButton && selectedCurrencyBalance ? ( {showMaxButton && selectedCurrencyBalance ? (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED} name={SwapEventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED}
element={ElementName.MAX_TOKEN_AMOUNT_BUTTON} element={InterfaceElementName.MAX_TOKEN_AMOUNT_BUTTON}
> >
<StyledBalanceMax onClick={onMax}> <StyledBalanceMax onClick={onMax}>
<Trans>Max</Trans> <Trans>Max</Trans>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent, Token } from '@uniswap/sdk-core'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
...@@ -315,8 +315,8 @@ export default function CurrencyInputPanel({ ...@@ -315,8 +315,8 @@ export default function CurrencyInputPanel({
{showMaxButton && selectedCurrencyBalance ? ( {showMaxButton && selectedCurrencyBalance ? (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED} name={SwapEventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED}
element={ElementName.MAX_TOKEN_AMOUNT_BUTTON} element={InterfaceElementName.MAX_TOKEN_AMOUNT_BUTTON}
> >
<StyledBalanceMax onClick={onMax}> <StyledBalanceMax onClick={onMax}>
<Trans>MAX</Trans> <Trans>MAX</Trans>
......
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { t, Trans } from '@lingui/macro' import { t, Trans } from '@lingui/macro'
import { sendAnalyticsEvent, Trace, TraceEvent, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, Trace, TraceEvent, useTrace } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName, SectionName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName, InterfaceSectionName } from '@uniswap/analytics-events'
import clsx from 'clsx' import clsx from 'clsx'
import useDebounce from 'hooks/useDebounce' import useDebounce from 'hooks/useDebounce'
import { useIsNftPage } from 'hooks/useIsNftPage' import { useIsNftPage } from 'hooks/useIsNftPage'
...@@ -109,7 +109,7 @@ export const SearchBar = () => { ...@@ -109,7 +109,7 @@ export const SearchBar = () => {
const isMobileOrTablet = isMobile || isTablet const isMobileOrTablet = isMobile || isTablet
const trace = useTrace({ section: SectionName.NAVBAR_SEARCH }) const trace = useTrace({ section: InterfaceSectionName.NAVBAR_SEARCH })
const navbarSearchEventProperties = { const navbarSearchEventProperties = {
navbar_search_input_text: debouncedSearchValue, navbar_search_input_text: debouncedSearchValue,
...@@ -146,7 +146,7 @@ export const SearchBar = () => { ...@@ -146,7 +146,7 @@ export const SearchBar = () => {
}, [handleKeyPress, inputRef]) }, [handleKeyPress, inputRef])
return ( return (
<Trace section={SectionName.NAVBAR_SEARCH}> <Trace section={InterfaceSectionName.NAVBAR_SEARCH}>
<Box <Box
position={{ sm: 'fixed', md: 'absolute', xl: 'relative' }} position={{ sm: 'fixed', md: 'absolute', xl: 'relative' }}
width={{ sm: isOpen ? 'viewWidth' : 'auto', md: 'auto' }} width={{ sm: isOpen ? 'viewWidth' : 'auto', md: 'auto' }}
...@@ -178,8 +178,8 @@ export const SearchBar = () => { ...@@ -178,8 +178,8 @@ export const SearchBar = () => {
</Box> </Box>
<TraceEvent <TraceEvent
events={[BrowserEvent.onFocus]} events={[BrowserEvent.onFocus]}
name={EventName.NAVBAR_SEARCH_SELECTED} name={InterfaceEventName.NAVBAR_SEARCH_SELECTED}
element={ElementName.NAVBAR_SEARCH_INPUT} element={InterfaceElementName.NAVBAR_SEARCH_INPUT}
properties={{ ...trace }} properties={{ ...trace }}
> >
<Trans <Trans
...@@ -192,7 +192,9 @@ export const SearchBar = () => { ...@@ -192,7 +192,9 @@ export const SearchBar = () => {
!isOpen && toggleOpen() !isOpen && toggleOpen()
setSearchValue(event.target.value) setSearchValue(event.target.value)
}} }}
onBlur={() => sendAnalyticsEvent(EventName.NAVBAR_SEARCH_EXITED, navbarSearchEventProperties)} onBlur={() =>
sendAnalyticsEvent(InterfaceEventName.NAVBAR_SEARCH_EXITED, navbarSearchEventProperties)
}
className={`${styles.searchBarInput} ${styles.searchContentLeftAlign}`} className={`${styles.searchBarInput} ${styles.searchContentLeftAlign}`}
value={searchValue} value={searchValue}
ref={inputRef} ref={inputRef}
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { useTrace } from '@uniswap/analytics' import { useTrace } from '@uniswap/analytics'
import { NavBarSearchTypes, SectionName } from '@uniswap/analytics-events' import { InterfaceSectionName, NavBarSearchTypes } from '@uniswap/analytics-events'
import { useIsNftPage } from 'hooks/useIsNftPage' import { useIsNftPage } from 'hooks/useIsNftPage'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Column, Row } from 'nft/components/Flex' import { Column, Row } from 'nft/components/Flex'
...@@ -202,7 +202,7 @@ export const SearchBarDropdown = ({ ...@@ -202,7 +202,7 @@ export const SearchBarDropdown = ({
(isNFTPage && (hasVerifiedCollection || !hasVerifiedToken)) || (isNFTPage && (hasVerifiedCollection || !hasVerifiedToken)) ||
(!isNFTPage && !hasVerifiedToken && hasVerifiedCollection) (!isNFTPage && !hasVerifiedToken && hasVerifiedCollection)
const trace = JSON.stringify(useTrace({ section: SectionName.NAVBAR_SEARCH })) const trace = JSON.stringify(useTrace({ section: InterfaceSectionName.NAVBAR_SEARCH }))
useEffect(() => { useEffect(() => {
const eventProperties = { total_suggestions: totalSuggestions, query_text: queryText, ...JSON.parse(trace) } const eventProperties = { total_suggestions: totalSuggestions, query_text: queryText, ...JSON.parse(trace) }
......
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { InterfaceEventName } from '@uniswap/analytics-events'
import { formatUSDPrice } from '@uniswap/conedison/format' import { formatUSDPrice } from '@uniswap/conedison/format'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import clsx from 'clsx' import clsx from 'clsx'
...@@ -71,7 +71,7 @@ export const CollectionRow = ({ ...@@ -71,7 +71,7 @@ export const CollectionRow = ({
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
addToSearchHistory(collection) addToSearchHistory(collection)
toggleOpen() toggleOpen()
sendAnalyticsEvent(EventName.NAVBAR_RESULT_SELECTED, { ...eventProperties }) sendAnalyticsEvent(InterfaceEventName.NAVBAR_RESULT_SELECTED, { ...eventProperties })
}, [addToSearchHistory, collection, toggleOpen, eventProperties]) }, [addToSearchHistory, collection, toggleOpen, eventProperties])
useEffect(() => { useEffect(() => {
...@@ -157,7 +157,7 @@ export const TokenRow = ({ token, isHovered, setHoveredIndex, toggleOpen, index, ...@@ -157,7 +157,7 @@ export const TokenRow = ({ token, isHovered, setHoveredIndex, toggleOpen, index,
const handleClick = useCallback(() => { const handleClick = useCallback(() => {
addToSearchHistory(token) addToSearchHistory(token)
toggleOpen() toggleOpen()
sendAnalyticsEvent(EventName.NAVBAR_RESULT_SELECTED, { ...eventProperties }) sendAnalyticsEvent(InterfaceEventName.NAVBAR_RESULT_SELECTED, { ...eventProperties })
}, [addToSearchHistory, toggleOpen, token, eventProperties]) }, [addToSearchHistory, toggleOpen, token, eventProperties])
const [bridgedAddress, bridgedChain, L2Icon] = useBridgedAddress(token) const [bridgedAddress, bridgedChain, L2Icon] = useBridgedAddress(token)
......
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import { Currency } from '@uniswap/sdk-core' import { Currency } from '@uniswap/sdk-core'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import CurrencyLogo from 'components/Logo/CurrencyLogo' import CurrencyLogo from 'components/Logo/CurrencyLogo'
...@@ -70,9 +70,9 @@ export default function CommonBases({ ...@@ -70,9 +70,9 @@ export default function CommonBases({
return ( return (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick, BrowserEvent.onKeyPress]} events={[BrowserEvent.onClick, BrowserEvent.onKeyPress]}
name={EventName.TOKEN_SELECTED} name={InterfaceEventName.TOKEN_SELECTED}
properties={formatAnalyticsEventProperties(currency, searchQuery, isAddressSearch)} properties={formatAnalyticsEventProperties(currency, searchQuery, isAddressSearch)}
element={ElementName.COMMON_BASES_CURRENCY_BUTTON} element={InterfaceElementName.COMMON_BASES_CURRENCY_BUTTON}
key={currencyId(currency)} key={currencyId(currency)}
> >
<BaseWrapper <BaseWrapper
......
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import TokenSafetyIcon from 'components/TokenSafety/TokenSafetyIcon' import TokenSafetyIcon from 'components/TokenSafety/TokenSafetyIcon'
...@@ -131,9 +131,9 @@ export function CurrencyRow({ ...@@ -131,9 +131,9 @@ export function CurrencyRow({
return ( return (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick, BrowserEvent.onKeyPress]} events={[BrowserEvent.onClick, BrowserEvent.onKeyPress]}
name={EventName.TOKEN_SELECTED} name={InterfaceEventName.TOKEN_SELECTED}
properties={{ is_imported_by_user: customAdded, ...eventProperties }} properties={{ is_imported_by_user: customAdded, ...eventProperties }}
element={ElementName.TOKEN_SELECTOR_ROW} element={InterfaceElementName.TOKEN_SELECTOR_ROW}
> >
<MenuItem <MenuItem
tabIndex={0} tabIndex={0}
......
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { t, Trans } from '@lingui/macro' import { t, Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { EventName, ModalName } from '@uniswap/analytics-events' import { InterfaceEventName, InterfaceModalName } from '@uniswap/analytics-events'
import { Currency, Token } from '@uniswap/sdk-core' import { Currency, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
...@@ -181,7 +181,11 @@ export function CurrencySearch({ ...@@ -181,7 +181,11 @@ export function CurrencySearch({
return ( return (
<ContentWrapper> <ContentWrapper>
<Trace name={EventName.TOKEN_SELECTOR_OPENED} modal={ModalName.TOKEN_SELECTOR} shouldLogImpression> <Trace
name={InterfaceEventName.TOKEN_SELECTOR_OPENED}
modal={InterfaceModalName.TOKEN_SELECTOR}
shouldLogImpression
>
<PaddedColumn gap="16px"> <PaddedColumn gap="16px">
<RowBetween> <RowBetween>
<Text fontWeight={500} fontSize={16}> <Text fontWeight={500} fontSize={16}>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { Currency } from '@uniswap/sdk-core' import { Currency } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import CurrencyLogo from 'components/Logo/CurrencyLogo' import CurrencyLogo from 'components/Logo/CurrencyLogo'
...@@ -176,7 +176,7 @@ export default function TokenDetails({ ...@@ -176,7 +176,7 @@ export default function TokenDetails({
} }
return ( return (
<Trace <Trace
page={PageName.TOKEN_DETAILS_PAGE} page={InterfacePageName.TOKEN_DETAILS_PAGE}
properties={{ tokenAddress: address, tokenName: token?.name }} properties={{ tokenAddress: address, tokenName: token?.name }}
shouldLogImpression shouldLogImpression
> >
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import searchIcon from 'assets/svg/search.svg' import searchIcon from 'assets/svg/search.svg'
import xIcon from 'assets/svg/x.svg' import xIcon from 'assets/svg/x.svg'
import useDebounce from 'hooks/useDebounce' import useDebounce from 'hooks/useDebounce'
...@@ -80,8 +80,8 @@ export default function SearchBar() { ...@@ -80,8 +80,8 @@ export default function SearchBar() {
render={({ translation }) => ( render={({ translation }) => (
<TraceEvent <TraceEvent
events={[BrowserEvent.onFocus]} events={[BrowserEvent.onFocus]}
name={EventName.EXPLORE_SEARCH_SELECTED} name={InterfaceEventName.EXPLORE_SEARCH_SELECTED}
element={ElementName.EXPLORE_SEARCH_INPUT} element={InterfaceElementName.EXPLORE_SEARCH_INPUT}
> >
<SearchInput <SearchInput
type="search" type="search"
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { InterfaceEventName } from '@uniswap/analytics-events'
import { formatNumber, formatUSDPrice, NumberType } from '@uniswap/conedison/format' import { formatNumber, formatUSDPrice, NumberType } from '@uniswap/conedison/format'
import { ParentSize } from '@visx/responsive' import { ParentSize } from '@visx/responsive'
import SparklineChart from 'components/Charts/SparklineChart' import SparklineChart from 'components/Charts/SparklineChart'
...@@ -472,7 +472,9 @@ export const LoadedRow = forwardRef((props: LoadedRowProps, ref: ForwardedRef<HT ...@@ -472,7 +472,9 @@ export const LoadedRow = forwardRef((props: LoadedRowProps, ref: ForwardedRef<HT
<div ref={ref} data-testid={`token-table-row-${tokenName}`}> <div ref={ref} data-testid={`token-table-row-${tokenName}`}>
<StyledLink <StyledLink
to={getTokenDetailsURL(token.address ?? '', token.chain)} to={getTokenDetailsURL(token.address ?? '', token.chain)}
onClick={() => sendAnalyticsEvent(EventName.EXPLORE_TOKEN_ROW_CLICKED, exploreTokenSelectedEventProperties)} onClick={() =>
sendAnalyticsEvent(InterfaceEventName.EXPLORE_TOKEN_ROW_CLICKED, exploreTokenSelectedEventProperties)
}
> >
<TokenRow <TokenRow
header={false} header={false}
......
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import React from 'react' import React from 'react'
import { Check } from 'react-feather' import { Check } from 'react-feather'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
...@@ -116,9 +116,9 @@ export default function Option({ ...@@ -116,9 +116,9 @@ export default function Option({
const content = ( const content = (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.WALLET_SELECTED} name={InterfaceEventName.WALLET_SELECTED}
properties={{ wallet_type: header }} properties={{ wallet_type: header }}
element={ElementName.WALLET_TYPE_OPTION} element={InterfaceElementName.WALLET_TYPE_OPTION}
> >
<OptionCardClickable <OptionCardClickable
id={id} id={id}
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent, user } from '@uniswap/analytics' import { sendAnalyticsEvent, user } from '@uniswap/analytics'
import { CustomUserProperties, EventName, WalletConnectionResult } from '@uniswap/analytics-events' import { CustomUserProperties, InterfaceEventName, WalletConnectionResult } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { Connector } from '@web3-react/types' import { Connector } from '@web3-react/types'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
...@@ -125,7 +125,7 @@ const sendAnalyticsEventAndUserInfo = ( ...@@ -125,7 +125,7 @@ const sendAnalyticsEventAndUserInfo = (
chainId: number | undefined, chainId: number | undefined,
isReconnect: boolean isReconnect: boolean
) => { ) => {
sendAnalyticsEvent(EventName.WALLET_CONNECT_TXN_COMPLETED, { sendAnalyticsEvent(InterfaceEventName.WALLET_CONNECT_TXN_COMPLETED, {
result: WalletConnectionResult.SUCCEEDED, result: WalletConnectionResult.SUCCEEDED,
wallet_address: account, wallet_address: account,
wallet_type: walletType, wallet_type: walletType,
...@@ -236,7 +236,7 @@ export default function WalletModal({ ...@@ -236,7 +236,7 @@ export default function WalletModal({
console.debug(`web3-react connection error: ${error}`) console.debug(`web3-react connection error: ${error}`)
dispatch(updateConnectionError({ connectionType, error: error.message })) dispatch(updateConnectionError({ connectionType, error: error.message }))
sendAnalyticsEvent(EventName.WALLET_CONNECT_TXN_COMPLETED, { sendAnalyticsEvent(InterfaceEventName.WALLET_CONNECT_TXN_COMPLETED, {
result: WalletConnectionResult.FAILED, result: WalletConnectionResult.FAILED,
wallet_type: getConnectionName(connectionType, getIsMetaMask()), wallet_type: getConnectionName(connectionType, getIsMetaMask()),
}) })
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent, TraceEvent } from '@uniswap/analytics' import { sendAnalyticsEvent, TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { FiatOnrampAnnouncement } from 'components/FiatOnrampAnnouncement' import { FiatOnrampAnnouncement } from 'components/FiatOnrampAnnouncement'
import { IconWrapper } from 'components/Identicon/StatusIcon' import { IconWrapper } from 'components/Identicon/StatusIcon'
...@@ -284,9 +284,9 @@ function Web3StatusInner() { ...@@ -284,9 +284,9 @@ function Web3StatusInner() {
return ( return (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.CONNECT_WALLET_BUTTON_CLICKED} name={InterfaceEventName.CONNECT_WALLET_BUTTON_CLICKED}
properties={{ received_swap_quote: validSwapQuote }} properties={{ received_swap_quote: validSwapQuote }}
element={ElementName.CONNECT_WALLET_BUTTON} element={InterfaceElementName.CONNECT_WALLET_BUTTON}
> >
<Web3StatusConnectWrapper faded={!account}> <Web3StatusConnectWrapper faded={!account}>
<StyledConnectButton data-testid="navbar-connect-wallet" onClick={toggleWalletModal}> <StyledConnectButton data-testid="navbar-connect-wallet" onClick={toggleWalletModal}>
......
import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics'
import { EventName, SectionName, SwapPriceUpdateUserResponse } from '@uniswap/analytics-events' import {
InterfaceEventName,
InterfaceSectionName,
SwapEventName,
SwapPriceUpdateUserResponse,
} from '@uniswap/analytics-events'
import { Trade } from '@uniswap/router-sdk' import { Trade } from '@uniswap/router-sdk'
import { Currency, TradeType } from '@uniswap/sdk-core' import { Currency, TradeType } from '@uniswap/sdk-core'
import { import {
...@@ -58,7 +63,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg ...@@ -58,7 +63,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
[connector] [connector]
) )
const trace = useTrace({ section: SectionName.WIDGET }) const trace = useTrace({ section: InterfaceSectionName.WIDGET })
const [initialQuoteDate, setInitialQuoteDate] = useState<Date>() const [initialQuoteDate, setInitialQuoteDate] = useState<Date>()
const onInitialSwapQuote = useCallback( const onInitialSwapQuote = useCallback(
(trade: Trade<Currency, Currency, TradeType>) => { (trade: Trade<Currency, Currency, TradeType>) => {
...@@ -72,7 +77,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg ...@@ -72,7 +77,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
), ),
...trace, ...trace,
} }
sendAnalyticsEvent(EventName.SWAP_QUOTE_RECEIVED, eventProperties) sendAnalyticsEvent(SwapEventName.SWAP_QUOTE_RECEIVED, eventProperties)
}, },
[trace] [trace]
) )
...@@ -85,10 +90,10 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg ...@@ -85,10 +90,10 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
token_address: getTokenAddress(input), token_address: getTokenAddress(input),
...trace, ...trace,
} }
sendAnalyticsEvent(EventName.APPROVE_TOKEN_TXN_SUBMITTED, eventProperties) sendAnalyticsEvent(InterfaceEventName.APPROVE_TOKEN_TXN_SUBMITTED, eventProperties)
}, [inputs.value.INPUT, trace]) }, [inputs.value.INPUT, trace])
const onExpandSwapDetails = useCallback(() => { const onExpandSwapDetails = useCallback(() => {
sendAnalyticsEvent(EventName.SWAP_DETAILS_EXPANDED, { ...trace }) sendAnalyticsEvent(SwapEventName.SWAP_DETAILS_EXPANDED, { ...trace })
}, [trace]) }, [trace])
const onSwapPriceUpdateAck = useCallback( const onSwapPriceUpdateAck = useCallback(
(stale: Trade<Currency, Currency, TradeType>, update: Trade<Currency, Currency, TradeType>) => { (stale: Trade<Currency, Currency, TradeType>, update: Trade<Currency, Currency, TradeType>) => {
...@@ -100,7 +105,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg ...@@ -100,7 +105,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
price_update_basis_points: getPriceUpdateBasisPoints(stale.executionPrice, update.executionPrice), price_update_basis_points: getPriceUpdateBasisPoints(stale.executionPrice, update.executionPrice),
...trace, ...trace,
} }
sendAnalyticsEvent(EventName.SWAP_PRICE_UPDATE_ACKNOWLEDGED, eventProperties) sendAnalyticsEvent(SwapEventName.SWAP_PRICE_UPDATE_ACKNOWLEDGED, eventProperties)
}, },
[trace] [trace]
) )
...@@ -127,7 +132,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg ...@@ -127,7 +132,7 @@ export default function Widget({ token, onTokenChange, onReviewSwapClick }: Widg
swap_quote_block_number: undefined, swap_quote_block_number: undefined,
...trace, ...trace,
} }
sendAnalyticsEvent(EventName.SWAP_SUBMITTED_BUTTON_CLICKED, eventProperties) sendAnalyticsEvent(SwapEventName.SWAP_SUBMITTED_BUTTON_CLICKED, eventProperties)
}, },
[initialQuoteDate, trace] [initialQuoteDate, trace]
) )
......
import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics'
import { EventName, SectionName } from '@uniswap/analytics-events' import { InterfaceSectionName, SwapEventName } from '@uniswap/analytics-events'
import { Currency, Field, SwapController, SwapEventHandlers, TradeType } from '@uniswap/widgets' import { Currency, Field, SwapController, SwapEventHandlers, TradeType } from '@uniswap/widgets'
import CurrencySearchModal from 'components/SearchModal/CurrencySearchModal' import CurrencySearchModal from 'components/SearchModal/CurrencySearchModal'
import { useCallback, useEffect, useMemo, useState } from 'react' import { useCallback, useEffect, useMemo, useState } from 'react'
...@@ -26,7 +26,7 @@ export function useSyncWidgetInputs({ ...@@ -26,7 +26,7 @@ export function useSyncWidgetInputs({
token?: Currency token?: Currency
onTokenChange?: (token: Currency) => void onTokenChange?: (token: Currency) => void
}) { }) {
const trace = useTrace({ section: SectionName.WIDGET }) const trace = useTrace({ section: InterfaceSectionName.WIDGET })
const [type, setType] = useState<SwapValue['type']>(TradeType.EXACT_INPUT) const [type, setType] = useState<SwapValue['type']>(TradeType.EXACT_INPUT)
const [amount, setAmount] = useState<SwapValue['amount']>(EMPTY_AMOUNT) const [amount, setAmount] = useState<SwapValue['amount']>(EMPTY_AMOUNT)
...@@ -45,7 +45,7 @@ export function useSyncWidgetInputs({ ...@@ -45,7 +45,7 @@ export function useSyncWidgetInputs({
const onAmountChange = useCallback( const onAmountChange = useCallback(
(field: Field, amount: string, origin?: 'max') => { (field: Field, amount: string, origin?: 'max') => {
if (origin === 'max') { if (origin === 'max') {
sendAnalyticsEvent(EventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED, { ...trace }) sendAnalyticsEvent(SwapEventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED, { ...trace })
} }
setType(field === Field.INPUT ? TradeType.EXACT_INPUT : TradeType.EXACT_OUTPUT) setType(field === Field.INPUT ? TradeType.EXACT_INPUT : TradeType.EXACT_OUTPUT)
setAmount(amount) setAmount(amount)
...@@ -54,7 +54,7 @@ export function useSyncWidgetInputs({ ...@@ -54,7 +54,7 @@ export function useSyncWidgetInputs({
) )
const onSwitchTokens = useCallback(() => { const onSwitchTokens = useCallback(() => {
sendAnalyticsEvent(EventName.SWAP_TOKENS_REVERSED, { ...trace }) sendAnalyticsEvent(SwapEventName.SWAP_TOKENS_REVERSED, { ...trace })
setType((type) => invertTradeType(type)) setType((type) => invertTradeType(type))
setTokens((tokens) => ({ setTokens((tokens) => ({
[Field.INPUT]: tokens[Field.OUTPUT], [Field.INPUT]: tokens[Field.OUTPUT],
......
import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics'
import { EventName, SectionName } from '@uniswap/analytics-events' import { InterfaceEventName, InterfaceSectionName, SwapEventName } from '@uniswap/analytics-events'
import { import {
TradeType, TradeType,
Transaction, Transaction,
...@@ -22,7 +22,7 @@ import { currencyId } from 'utils/currencyId' ...@@ -22,7 +22,7 @@ import { currencyId } from 'utils/currencyId'
/** Integrates the Widget's transactions, showing the widget's transactions in the app. */ /** Integrates the Widget's transactions, showing the widget's transactions in the app. */
export function useSyncWidgetTransactions() { export function useSyncWidgetTransactions() {
const trace = useTrace({ section: SectionName.WIDGET }) const trace = useTrace({ section: InterfaceSectionName.WIDGET })
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const addTransaction = useTransactionAdder() const addTransaction = useTransactionAdder()
...@@ -49,7 +49,7 @@ export function useSyncWidgetTransactions() { ...@@ -49,7 +49,7 @@ export function useSyncWidgetTransactions() {
type: type === WidgetTransactionType.WRAP ? WrapType.WRAP : WrapType.UNWRAP, type: type === WidgetTransactionType.WRAP ? WrapType.WRAP : WrapType.UNWRAP,
...trace, ...trace,
} }
sendAnalyticsEvent(EventName.WRAP_TOKEN_TXN_SUBMITTED, eventProperties) sendAnalyticsEvent(InterfaceEventName.WRAP_TOKEN_TXN_SUBMITTED, eventProperties)
const { amount } = transaction.info const { amount } = transaction.info
addTransaction(response, { addTransaction(response, {
type: AppTransactionType.WRAP, type: AppTransactionType.WRAP,
...@@ -67,7 +67,7 @@ export function useSyncWidgetTransactions() { ...@@ -67,7 +67,7 @@ export function useSyncWidgetTransactions() {
}), }),
...trace, ...trace,
} }
sendAnalyticsEvent(EventName.SWAP_SIGNED, eventProperties) sendAnalyticsEvent(SwapEventName.SWAP_SIGNED, eventProperties)
const baseTxInfo = { const baseTxInfo = {
type: AppTransactionType.SWAP, type: AppTransactionType.SWAP,
tradeType, tradeType,
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { ModalName } from '@uniswap/analytics-events' import { InterfaceModalName } from '@uniswap/analytics-events'
import { Trade } from '@uniswap/router-sdk' import { Trade } from '@uniswap/router-sdk'
import { Currency, CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core'
import { ReactNode, useCallback, useMemo, useState } from 'react' import { ReactNode, useCallback, useMemo, useState } from 'react'
...@@ -122,7 +122,7 @@ export default function ConfirmSwapModal({ ...@@ -122,7 +122,7 @@ export default function ConfirmSwapModal({
) )
return ( return (
<Trace modal={ModalName.CONFIRM_SWAP}> <Trace modal={InterfaceModalName.CONFIRM_SWAP}>
<TransactionConfirmationModal <TransactionConfirmationModal
isOpen={isOpen} isOpen={isOpen}
onDismiss={onModalDismiss} onDismiss={onModalDismiss}
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events'
import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Currency, Percent, TradeType } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import AnimatedDropdown from 'components/AnimatedDropdown' import AnimatedDropdown from 'components/AnimatedDropdown'
...@@ -123,8 +123,8 @@ export default function SwapDetailsDropdown({ trade, syncing, loading, allowedSl ...@@ -123,8 +123,8 @@ export default function SwapDetailsDropdown({ trade, syncing, loading, allowedSl
<AutoColumn gap="sm" style={{ width: '100%', marginBottom: '-8px' }}> <AutoColumn gap="sm" style={{ width: '100%', marginBottom: '-8px' }}>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.SWAP_DETAILS_EXPANDED} name={SwapEventName.SWAP_DETAILS_EXPANDED}
element={ElementName.SWAP_DETAILS_DROPDOWN} element={InterfaceElementName.SWAP_DETAILS_DROPDOWN}
shouldLogImpression={!showDetails} shouldLogImpression={!showDetails}
> >
<StyledHeaderRow onClick={() => setShowDetails(!showDetails)} disabled={!trade} open={showDetails}> <StyledHeaderRow onClick={() => setShowDetails(!showDetails)} disabled={!trade} open={showDetails}>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core'
import useTransactionDeadline from 'hooks/useTransactionDeadline' import useTransactionDeadline from 'hooks/useTransactionDeadline'
import { import {
...@@ -131,8 +131,8 @@ export default function SwapModalFooter({ ...@@ -131,8 +131,8 @@ export default function SwapModalFooter({
<AutoRow> <AutoRow>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
element={ElementName.CONFIRM_SWAP_BUTTON} element={InterfaceElementName.CONFIRM_SWAP_BUTTON}
name={EventName.SWAP_SUBMITTED_BUTTON_CLICKED} name={SwapEventName.SWAP_SUBMITTED_BUTTON_CLICKED}
properties={formatAnalyticsEventProperties({ properties={formatAnalyticsEventProperties({
trade, trade,
hash, hash,
...@@ -150,7 +150,7 @@ export default function SwapModalFooter({ ...@@ -150,7 +150,7 @@ export default function SwapModalFooter({
onClick={onConfirm} onClick={onConfirm}
disabled={disabledConfirm} disabled={disabledConfirm}
style={{ margin: '10px 0 0 0' }} style={{ margin: '10px 0 0 0' }}
id={ElementName.CONFIRM_SWAP_BUTTON} id={InterfaceElementName.CONFIRM_SWAP_BUTTON}
> >
<Text fontSize={20} fontWeight={500}> <Text fontSize={20} fontWeight={500}>
<Trans>Confirm Swap</Trans> <Trans>Confirm Swap</Trans>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName, SwapPriceUpdateUserResponse } from '@uniswap/analytics-events' import { SwapEventName, SwapPriceUpdateUserResponse } from '@uniswap/analytics-events'
import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Currency, Percent, TradeType } from '@uniswap/sdk-core'
import { getPriceUpdateBasisPoints } from 'lib/utils/analytics' import { getPriceUpdateBasisPoints } from 'lib/utils/analytics'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
...@@ -91,7 +91,7 @@ export default function SwapModalHeader({ ...@@ -91,7 +91,7 @@ export default function SwapModalHeader({
useEffect(() => { useEffect(() => {
if (shouldLogModalCloseEvent && showAcceptChanges) if (shouldLogModalCloseEvent && showAcceptChanges)
sendAnalyticsEvent( sendAnalyticsEvent(
EventName.SWAP_PRICE_UPDATE_ACKNOWLEDGED, SwapEventName.SWAP_PRICE_UPDATE_ACKNOWLEDGED,
formatAnalyticsEventProperties(trade, priceUpdate, SwapPriceUpdateUserResponse.REJECTED) formatAnalyticsEventProperties(trade, priceUpdate, SwapPriceUpdateUserResponse.REJECTED)
) )
setShouldLogModalCloseEvent(false) setShouldLogModalCloseEvent(false)
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, SwapEventName } from '@uniswap/analytics-events'
import { Protocol } from '@uniswap/router-sdk' import { Protocol } from '@uniswap/router-sdk'
import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Currency, Percent, TradeType } from '@uniswap/sdk-core'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
...@@ -66,8 +66,8 @@ export default memo(function SwapRoute({ trade, syncing, fixedOpen = false, ...r ...@@ -66,8 +66,8 @@ export default memo(function SwapRoute({ trade, syncing, fixedOpen = false, ...r
<Wrapper {...rest} darkMode={darkMode} fixedOpen={fixedOpen}> <Wrapper {...rest} darkMode={darkMode} fixedOpen={fixedOpen}>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.SWAP_AUTOROUTER_VISUALIZATION_EXPANDED} name={SwapEventName.SWAP_AUTOROUTER_VISUALIZATION_EXPANDED}
element={ElementName.AUTOROUTER_VISUALIZATION_ROW} element={InterfaceElementName.AUTOROUTER_VISUALIZATION_ROW}
shouldLogImpression={!open} shouldLogImpression={!open}
> >
<RowBetween onClick={() => setOpen(!open)}> <RowBetween onClick={() => setOpen(!open)}>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { InterfaceEventName } from '@uniswap/analytics-events'
import { Currency } from '@uniswap/sdk-core' import { Currency } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import useNativeCurrency from 'lib/hooks/useNativeCurrency' import useNativeCurrency from 'lib/hooks/useNativeCurrency'
...@@ -104,7 +104,7 @@ export default function useWrapCallback( ...@@ -104,7 +104,7 @@ export default function useWrapCallback(
network.chainId !== chainId || network.chainId !== chainId ||
wethContract.address !== WRAPPED_NATIVE_CURRENCY[network.chainId]?.address wethContract.address !== WRAPPED_NATIVE_CURRENCY[network.chainId]?.address
) { ) {
sendAnalyticsEvent(EventName.WRAP_TOKEN_TXN_INVALIDATED, { sendAnalyticsEvent(InterfaceEventName.WRAP_TOKEN_TXN_INVALIDATED, {
...eventProperties, ...eventProperties,
contract_address: wethContract.address, contract_address: wethContract.address,
contract_chain_id: network.chainId, contract_chain_id: network.chainId,
...@@ -122,7 +122,10 @@ Please file a bug detailing how this happened - https://github.com/Uniswap/inter ...@@ -122,7 +122,10 @@ Please file a bug detailing how this happened - https://github.com/Uniswap/inter
currencyAmountRaw: inputAmount?.quotient.toString(), currencyAmountRaw: inputAmount?.quotient.toString(),
chainId, chainId,
}) })
sendAnalyticsEvent(EventName.WRAP_TOKEN_TXN_SUBMITTED, { ...eventProperties, type: WrapType.WRAP }) sendAnalyticsEvent(InterfaceEventName.WRAP_TOKEN_TXN_SUBMITTED, {
...eventProperties,
type: WrapType.WRAP,
})
} catch (error) { } catch (error) {
console.error('Could not deposit', error) console.error('Could not deposit', error)
} }
...@@ -148,7 +151,10 @@ Please file a bug detailing how this happened - https://github.com/Uniswap/inter ...@@ -148,7 +151,10 @@ Please file a bug detailing how this happened - https://github.com/Uniswap/inter
currencyAmountRaw: inputAmount?.quotient.toString(), currencyAmountRaw: inputAmount?.quotient.toString(),
chainId, chainId,
}) })
sendAnalyticsEvent(EventName.WRAP_TOKEN_TXN_SUBMITTED, { ...eventProperties, type: WrapType.UNWRAP }) sendAnalyticsEvent(InterfaceEventName.WRAP_TOKEN_TXN_SUBMITTED, {
...eventProperties,
type: WrapType.UNWRAP,
})
} catch (error) { } catch (error) {
console.error('Could not withdraw', error) console.error('Could not withdraw', error)
} }
......
...@@ -3,7 +3,7 @@ import type { JsonRpcProvider, TransactionResponse } from '@ethersproject/provid ...@@ -3,7 +3,7 @@ import type { JsonRpcProvider, TransactionResponse } from '@ethersproject/provid
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { t, Trans } from '@lingui/macro' import { t, Trans } from '@lingui/macro'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { SwapEventName } from '@uniswap/analytics-events'
import { Trade } from '@uniswap/router-sdk' import { Trade } from '@uniswap/router-sdk'
import { Currency, TradeType } from '@uniswap/sdk-core' import { Currency, TradeType } from '@uniswap/sdk-core'
import { formatSwapSignedAnalyticsEventProperties } from 'lib/utils/analytics' import { formatSwapSignedAnalyticsEventProperties } from 'lib/utils/analytics'
...@@ -120,11 +120,11 @@ export default function useSendSwapTransaction( ...@@ -120,11 +120,11 @@ export default function useSendSwapTransaction(
}) })
.then((response) => { .then((response) => {
sendAnalyticsEvent( sendAnalyticsEvent(
EventName.SWAP_SIGNED, SwapEventName.SWAP_SIGNED,
formatSwapSignedAnalyticsEventProperties({ trade, txHash: response.hash }) formatSwapSignedAnalyticsEventProperties({ trade, txHash: response.hash })
) )
if (calldata !== response.data) { if (calldata !== response.data) {
sendAnalyticsEvent(EventName.SWAP_MODIFIED_IN_WALLET, { txHash: response.hash }) sendAnalyticsEvent(SwapEventName.SWAP_MODIFIED_IN_WALLET, { txHash: response.hash })
throw new InvalidSwapError( throw new InvalidSwapError(
t`Your swap was modified through your wallet. If this was a mistake, please cancel immediately or risk losing your funds.` t`Your swap was modified through your wallet. If this was a mistake, please cancel immediately or risk losing your funds.`
) )
......
import { MaxUint256 } from '@ethersproject/constants' import { MaxUint256 } from '@ethersproject/constants'
import type { TransactionResponse } from '@ethersproject/providers' import type { TransactionResponse } from '@ethersproject/providers'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { InterfaceEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { useTokenContract } from 'hooks/useContract' import { useTokenContract } from 'hooks/useContract'
...@@ -97,7 +97,7 @@ export function useApproval( ...@@ -97,7 +97,7 @@ export function useApproval(
token_symbol: token?.symbol, token_symbol: token?.symbol,
token_address: getTokenAddress(token), token_address: getTokenAddress(token),
} }
sendAnalyticsEvent(EventName.APPROVE_TOKEN_TXN_SUBMITTED, eventProperties) sendAnalyticsEvent(InterfaceEventName.APPROVE_TOKEN_TXN_SUBMITTED, eventProperties)
return { return {
response, response,
tokenAddress: token.address, tokenAddress: token.address,
......
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { formatEther } from '@ethersproject/units' import { formatEther } from '@ethersproject/units'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { NFTEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { useIsNftDetailsPage, useIsNftPage, useIsNftProfilePage } from 'hooks/useIsNftPage' import { useIsNftDetailsPage, useIsNftPage, useIsNftProfilePage } from 'hooks/useIsNftPage'
import { BagFooter } from 'nft/components/bag/BagFooter' import { BagFooter } from 'nft/components/bag/BagFooter'
...@@ -351,7 +351,7 @@ const Bag = () => { ...@@ -351,7 +351,7 @@ const Bag = () => {
onClick={() => { onClick={() => {
isMobile && toggleBag() isMobile && toggleBag()
setProfilePageState(ProfilePageStateType.LISTING) setProfilePageState(ProfilePageStateType.LISTING)
sendAnalyticsEvent(EventName.NFT_PROFILE_PAGE_START_SELL, { sendAnalyticsEvent(NFTEventName.NFT_PROFILE_PAGE_START_SELL, {
list_quantity: sellAssets.length, list_quantity: sellAssets.length,
collection_addresses: sellAssets.map((asset) => asset.asset_contract.address), collection_addresses: sellAssets.map((asset) => asset.asset_contract.address),
token_ids: sellAssets.map((asset) => asset.tokenId), token_ids: sellAssets.map((asset) => asset.tokenId),
......
import { sendAnalyticsEvent, Trace } from '@uniswap/analytics' import { sendAnalyticsEvent, Trace } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { NFTEventName } from '@uniswap/analytics-events'
import { BagRow, PriceChangeBagRow, UnavailableAssetsHeaderRow } from 'nft/components/bag/BagRow' import { BagRow, PriceChangeBagRow, UnavailableAssetsHeaderRow } from 'nft/components/bag/BagRow'
import { Column } from 'nft/components/Flex' import { Column } from 'nft/components/Flex'
import { useBag, useIsMobile } from 'nft/hooks' import { useBag, useIsMobile } from 'nft/hooks'
...@@ -46,7 +46,7 @@ export const BagContent = () => { ...@@ -46,7 +46,7 @@ export const BagContent = () => {
const hasAssets = itemsInBag.length > 0 const hasAssets = itemsInBag.length > 0
if (hasAssetsInReview) if (hasAssetsInReview)
sendAnalyticsEvent(EventName.NFT_BUY_BAG_CHANGED, { sendAnalyticsEvent(NFTEventName.NFT_BUY_BAG_CHANGED, {
usd_value: fetchedPriceData, usd_value: fetchedPriceData,
bag_quantity: itemsInBag, bag_quantity: itemsInBag,
...formatAssetEventProperties(priceChangedAssets), ...formatAssetEventProperties(priceChangedAssets),
...@@ -67,7 +67,7 @@ export const BagContent = () => { ...@@ -67,7 +67,7 @@ export const BagContent = () => {
<Column display={priceChangedAssets.length > 0 || unavailableAssets.length > 0 ? 'flex' : 'none'}> <Column display={priceChangedAssets.length > 0 || unavailableAssets.length > 0 ? 'flex' : 'none'}>
{unavailableAssets.length > 0 && ( {unavailableAssets.length > 0 && (
<Trace <Trace
name={EventName.NFT_BUY_BAG_CHANGED} name={NFTEventName.NFT_BUY_BAG_CHANGED}
properties={{ properties={{
usd_value: fetchedPriceData, usd_value: fetchedPriceData,
bag_quantity: itemsInBag.length, bag_quantity: itemsInBag.length,
......
...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber' ...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import { parseEther } from '@ethersproject/units' import { parseEther } from '@ethersproject/units'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, NFTEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import Loader from 'components/Loader' import Loader from 'components/Loader'
import { SupportedChainId } from 'constants/chains' import { SupportedChainId } from 'constants/chains'
...@@ -172,8 +172,8 @@ export const BagFooter = ({ ...@@ -172,8 +172,8 @@ export const BagFooter = ({
</Column> </Column>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.NFT_BUY_BAG_PAY} name={NFTEventName.NFT_BUY_BAG_PAY}
element={ElementName.NFT_BUY_BAG_PAY_BUTTON} element={InterfaceElementName.NFT_BUY_BAG_PAY_BUTTON}
properties={{ ...eventProperties }} properties={{ ...eventProperties }}
shouldLogImpression={connected && !disabled} shouldLogImpression={connected && !disabled}
> >
......
import { addressesByNetwork, SupportedChainId } from '@looksrare/sdk' import { addressesByNetwork, SupportedChainId } from '@looksrare/sdk'
import { sendAnalyticsEvent, Trace, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, Trace, useTrace } from '@uniswap/analytics'
import { EventName, ModalName } from '@uniswap/analytics-events' import { InterfaceModalName, NFTEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Column, Row } from 'nft/components/Flex' import { Column, Row } from 'nft/components/Flex'
...@@ -37,7 +37,7 @@ const ListingModal = () => { ...@@ -37,7 +37,7 @@ const ListingModal = () => {
const toggleCart = useBag((state) => state.toggleBag) const toggleCart = useBag((state) => state.toggleBag)
const looksRareNonceRef = useRef(looksRareNonce) const looksRareNonceRef = useRef(looksRareNonce)
const isMobile = useIsMobile() const isMobile = useIsMobile()
const trace = useTrace({ modal: ModalName.NFT_LISTING }) const trace = useTrace({ modal: InterfaceModalName.NFT_LISTING })
useEffect(() => { useEffect(() => {
useNFTList.subscribe((state) => (looksRareNonceRef.current = state.looksRareNonce)) useNFTList.subscribe((state) => (looksRareNonceRef.current = state.looksRareNonce))
...@@ -107,7 +107,7 @@ const ListingModal = () => { ...@@ -107,7 +107,7 @@ const ListingModal = () => {
// handles the modal wide listing state based on conglomeration of the wallet, collection, and listing states // handles the modal wide listing state based on conglomeration of the wallet, collection, and listing states
const startListingFlow = async () => { const startListingFlow = async () => {
if (!signer) return if (!signer) return
sendAnalyticsEvent(EventName.NFT_SELL_START_LISTING, { ...startListingEventProperties }) sendAnalyticsEvent(NFTEventName.NFT_SELL_START_LISTING, { ...startListingEventProperties })
setListingStatus(ListingStatus.SIGNING) setListingStatus(ListingStatus.SIGNING)
const addresses = addressesByNetwork[SupportedChainId.MAINNET] const addresses = addressesByNetwork[SupportedChainId.MAINNET]
const signerAddress = await signer.getAddress() const signerAddress = await signer.getAddress()
...@@ -168,7 +168,7 @@ const ListingModal = () => { ...@@ -168,7 +168,7 @@ const ListingModal = () => {
} else if (!paused) { } else if (!paused) {
setListingStatus(ListingStatus.FAILED) setListingStatus(ListingStatus.FAILED)
} }
sendAnalyticsEvent(EventName.NFT_LISTING_SIGNED, { sendAnalyticsEvent(NFTEventName.NFT_LISTING_COMPLETED, {
signatures_approved: listings.filter((asset) => asset.status === ListingStatus.APPROVED), signatures_approved: listings.filter((asset) => asset.status === ListingStatus.APPROVED),
list_quantity: listings.length, list_quantity: listings.length,
usd_value: ethPriceInUSD * totalEthListingValue, usd_value: ethPriceInUSD * totalEthListingValue,
...@@ -207,7 +207,7 @@ const ListingModal = () => { ...@@ -207,7 +207,7 @@ const ListingModal = () => {
const showSuccessScreen = useMemo(() => listingStatus === ListingStatus.APPROVED, [listingStatus]) const showSuccessScreen = useMemo(() => listingStatus === ListingStatus.APPROVED, [listingStatus])
return ( return (
<Trace modal={ModalName.NFT_LISTING}> <Trace modal={InterfaceModalName.NFT_LISTING}>
<Column paddingTop="20" paddingBottom="20" paddingLeft="12" paddingRight="12"> <Column paddingTop="20" paddingBottom="20" paddingLeft="12" paddingRight="12">
<Row className={headlineSmall} marginBottom="10"> <Row className={headlineSmall} marginBottom="10">
{isMobile && !showSuccessScreen && ( {isMobile && !showSuccessScreen && (
...@@ -234,7 +234,7 @@ const ListingModal = () => { ...@@ -234,7 +234,7 @@ const ListingModal = () => {
<Column overflowX="hidden" overflowY="auto" style={{ maxHeight: '60vh' }}> <Column overflowX="hidden" overflowY="auto" style={{ maxHeight: '60vh' }}>
{showSuccessScreen ? ( {showSuccessScreen ? (
<Trace <Trace
name={EventName.NFT_LISTING_COMPLETED} name={NFTEventName.NFT_LISTING_COMPLETED}
properties={{ list_quantity: listings.length, usd_value: ethPriceInUSD * totalEthListingValue, ...trace }} properties={{ list_quantity: listings.length, usd_value: ethPriceInUSD * totalEthListingValue, ...trace }}
shouldLogImpression shouldLogImpression
> >
......
import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics'
import { EventName, PageName } from '@uniswap/analytics-events' import { InterfacePageName, NFTEventName } from '@uniswap/analytics-events'
import { ChainId } from '@uniswap/smart-order-router' import { ChainId } from '@uniswap/smart-order-router'
import { MouseoverTooltip } from 'components/Tooltip' import { MouseoverTooltip } from 'components/Tooltip'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
...@@ -101,7 +101,7 @@ export const BuyCell = ({ ...@@ -101,7 +101,7 @@ export const BuyCell = ({
return itemsInBag.some((item) => asset.tokenId === item.asset.tokenId && asset.address === item.asset.address) return itemsInBag.some((item) => asset.tokenId === item.asset.tokenId && asset.address === item.asset.address)
}, [asset, itemsInBag]) }, [asset, itemsInBag])
const trace = useTrace({ page: PageName.NFT_COLLECTION_PAGE }) const trace = useTrace({ page: InterfacePageName.NFT_COLLECTION_PAGE })
const eventProperties = { const eventProperties = {
collection_address: asset.address, collection_address: asset.address,
...@@ -120,7 +120,7 @@ export const BuyCell = ({ ...@@ -120,7 +120,7 @@ export const BuyCell = ({
e.preventDefault() e.preventDefault()
isSelected ? removeAsset([asset]) : selectAsset([asset]) isSelected ? removeAsset([asset]) : selectAsset([asset])
!isSelected && !cartExpanded && !isMobile && toggleCart() !isSelected && !cartExpanded && !isMobile && toggleCart()
!isSelected && sendAnalyticsEvent(EventName.NFT_BUY_ADDED, { eventProperties }) !isSelected && sendAnalyticsEvent(NFTEventName.NFT_BUY_ADDED, { eventProperties })
}} }}
disabled={event.orderStatus !== OrderStatus.VALID} disabled={event.orderStatus !== OrderStatus.VALID}
> >
......
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, NFTEventName } from '@uniswap/analytics-events'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Row } from 'nft/components/Flex' import { Row } from 'nft/components/Flex'
import { useIsCollectionLoading } from 'nft/hooks' import { useIsCollectionLoading } from 'nft/hooks'
...@@ -41,8 +41,8 @@ export const ActivitySwitcher = ({ ...@@ -41,8 +41,8 @@ export const ActivitySwitcher = ({
</Box> </Box>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
element={ElementName.NFT_ACTIVITY_TAB} element={InterfaceElementName.NFT_ACTIVITY_TAB}
name={EventName.NFT_ACTIVITY_SELECTED} name={NFTEventName.NFT_ACTIVITY_SELECTED}
> >
<Box <Box
as="button" as="button"
......
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics' import { sendAnalyticsEvent, useTrace } from '@uniswap/analytics'
import { EventName, PageName } from '@uniswap/analytics-events' import { InterfacePageName, NFTEventName } from '@uniswap/analytics-events'
import { MouseoverTooltip } from 'components/Tooltip' import { MouseoverTooltip } from 'components/Tooltip'
import Tooltip from 'components/Tooltip' import Tooltip from 'components/Tooltip'
import { NftStandard } from 'graphql/data/__generated__/types-and-hooks' import { NftStandard } from 'graphql/data/__generated__/types-and-hooks'
...@@ -60,7 +60,7 @@ export const CollectionAsset = ({ ...@@ -60,7 +60,7 @@ export const CollectionAsset = ({
const itemsInBag = useBag((state) => state.itemsInBag) const itemsInBag = useBag((state) => state.itemsInBag)
const bagExpanded = useBag((state) => state.bagExpanded) const bagExpanded = useBag((state) => state.bagExpanded)
const setBagExpanded = useBag((state) => state.setBagExpanded) const setBagExpanded = useBag((state) => state.setBagExpanded)
const trace = useTrace({ page: PageName.NFT_COLLECTION_PAGE }) const trace = useTrace({ page: InterfacePageName.NFT_COLLECTION_PAGE })
const { isSelected } = useMemo(() => { const { isSelected } = useMemo(() => {
const matchingItems = itemsInBag.filter( const matchingItems = itemsInBag.filter(
...@@ -94,7 +94,7 @@ export const CollectionAsset = ({ ...@@ -94,7 +94,7 @@ export const CollectionAsset = ({
if (!bagExpanded && !isMobile && !bagManuallyClosed) { if (!bagExpanded && !isMobile && !bagManuallyClosed) {
setBagExpanded({ bagExpanded: true }) setBagExpanded({ bagExpanded: true })
} }
sendAnalyticsEvent(EventName.NFT_BUY_ADDED, { sendAnalyticsEvent(NFTEventName.NFT_BUY_ADDED, {
collection_address: asset.address, collection_address: asset.address,
token_id: asset.tokenId, token_id: asset.tokenId,
token_type: asset.tokenType, token_type: asset.tokenType,
......
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, NFTEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import clsx from 'clsx' import clsx from 'clsx'
import { OpacityHoverState } from 'components/Common' import { OpacityHoverState } from 'components/Common'
...@@ -512,8 +512,8 @@ export const CollectionNfts = ({ contractAddress, collectionStats, rarityVerifie ...@@ -512,8 +512,8 @@ export const CollectionNfts = ({ contractAddress, collectionStats, rarityVerifie
<ActionsSubContainer> <ActionsSubContainer>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
element={ElementName.NFT_FILTER_BUTTON} element={InterfaceElementName.NFT_FILTER_BUTTON}
name={EventName.NFT_FILTER_OPENED} name={NFTEventName.NFT_FILTER_OPENED}
shouldLogImpression={!isFiltersExpanded} shouldLogImpression={!isFiltersExpanded}
properties={{ collection_address: contractAddress, chain_id: chainId }} properties={{ collection_address: contractAddress, chain_id: chainId }}
> >
......
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName, FilterTypes } from '@uniswap/analytics-events' import { NFTEventName, NFTFilterTypes } from '@uniswap/analytics-events'
import clsx from 'clsx' import clsx from 'clsx'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import * as styles from 'nft/components/collection/Filters.css' import * as styles from 'nft/components/collection/Filters.css'
...@@ -98,7 +98,7 @@ const MarketplaceItem = ({ ...@@ -98,7 +98,7 @@ const MarketplaceItem = ({
removeMarket(value) removeMarket(value)
setCheckboxSelected(false) setCheckboxSelected(false)
} }
sendAnalyticsEvent(EventName.NFT_FILTER_SELECTED, { filter_type: FilterTypes.MARKETPLACE }) sendAnalyticsEvent(NFTEventName.NFT_FILTER_SELECTED, { filter_type: NFTFilterTypes.MARKETPLACE })
} }
const checkbox = ( const checkbox = (
......
import 'rc-slider/assets/index.css' import 'rc-slider/assets/index.css'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName, FilterTypes } from '@uniswap/analytics-events' import { NFTEventName, NFTFilterTypes } from '@uniswap/analytics-events'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Row } from 'nft/components/Flex' import { Row } from 'nft/components/Flex'
import { NumericInput } from 'nft/components/layout/Input' import { NumericInput } from 'nft/components/layout/Input'
...@@ -55,7 +55,7 @@ export const PriceRange = () => { ...@@ -55,7 +55,7 @@ export const PriceRange = () => {
e.currentTarget.placeholder = placeholderText e.currentTarget.placeholder = placeholderText
setPlaceholderText('') setPlaceholderText('')
if (minPrice || maxPrice) if (minPrice || maxPrice)
sendAnalyticsEvent(EventName.NFT_FILTER_SELECTED, { filter_type: FilterTypes.PRICE_RANGE }) sendAnalyticsEvent(NFTEventName.NFT_FILTER_SELECTED, { filter_type: NFTFilterTypes.PRICE_RANGE })
} }
const updateMinPriceRange = (v: FormEvent<HTMLInputElement>) => { const updateMinPriceRange = (v: FormEvent<HTMLInputElement>) => {
......
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName, FilterTypes } from '@uniswap/analytics-events' import { NFTEventName, NFTFilterTypes } from '@uniswap/analytics-events'
import useDebounce from 'hooks/useDebounce' import useDebounce from 'hooks/useDebounce'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Column, Row } from 'nft/components/Flex' import { Column, Row } from 'nft/components/Flex'
...@@ -61,7 +61,7 @@ const TraitItem = ({ ...@@ -61,7 +61,7 @@ const TraitItem = ({
removeTrait(trait) removeTrait(trait)
setCheckboxSelected(false) setCheckboxSelected(false)
} }
sendAnalyticsEvent(EventName.NFT_FILTER_SELECTED, { filter_type: FilterTypes.TRAIT }) sendAnalyticsEvent(NFTEventName.NFT_FILTER_SELECTED, { filter_type: NFTFilterTypes.TRAIT })
} }
const showFullTraitName = shouldShow && trait_type === trait.trait_type && trait_value === trait.trait_value const showFullTraitName = shouldShow && trait_type === trait.trait_type && trait_value === trait.trait_value
......
import { formatEther } from '@ethersproject/units' import { formatEther } from '@ethersproject/units'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace, useTrace } from '@uniswap/analytics' import { Trace, useTrace } from '@uniswap/analytics'
import { EventName, ModalName } from '@uniswap/analytics-events' import { InterfaceModalName, NFTEventName } from '@uniswap/analytics-events'
import clsx from 'clsx' import clsx from 'clsx'
import { OpacityHoverState } from 'components/Common' import { OpacityHoverState } from 'components/Common'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
...@@ -58,7 +58,7 @@ const TxCompleteModal = () => { ...@@ -58,7 +58,7 @@ const TxCompleteModal = () => {
const isMobile = useIsMobile() const isMobile = useIsMobile()
const txHashUrl = getExplorerLink(1, txHash, ExplorerDataType.TRANSACTION) const txHashUrl = getExplorerLink(1, txHash, ExplorerDataType.TRANSACTION)
const shouldShowModal = (txState === TxStateType.Success || txState === TxStateType.Failed) && txState const shouldShowModal = (txState === TxStateType.Success || txState === TxStateType.Failed) && txState
const trace = useTrace({ modal: ModalName.NFT_TX_COMPLETE }) const trace = useTrace({ modal: InterfaceModalName.NFT_TX_COMPLETE })
const { const {
nftsPurchased, nftsPurchased,
nftsNotPurchased, nftsNotPurchased,
...@@ -110,7 +110,7 @@ const TxCompleteModal = () => { ...@@ -110,7 +110,7 @@ const TxCompleteModal = () => {
{/* Successfully purchased NFTs */} {/* Successfully purchased NFTs */}
{showPurchasedModal && ( {showPurchasedModal && (
<Trace <Trace
name={EventName.NFT_BUY_BAG_SUCCEEDED} name={NFTEventName.NFT_BUY_BAG_SUCCEEDED}
properties={{ properties={{
buy_quantity: nftsPurchased.length, buy_quantity: nftsPurchased.length,
usd_value: parseFloat(formatEther(totalPurchaseValue)) * ethPrice, usd_value: parseFloat(formatEther(totalPurchaseValue)) * ethPrice,
...@@ -189,7 +189,7 @@ const TxCompleteModal = () => { ...@@ -189,7 +189,7 @@ const TxCompleteModal = () => {
/* Showing both purchases & refunds */ /* Showing both purchases & refunds */
(showPurchasedModal ? ( (showPurchasedModal ? (
<Trace <Trace
name={EventName.NFT_BUY_BAG_REFUNDED} name={NFTEventName.NFT_BUY_BAG_REFUNDED}
properties={{ properties={{
buy_quantity: nftsPurchased.length, buy_quantity: nftsPurchased.length,
fail_quantity: nftsNotPurchased.length, fail_quantity: nftsNotPurchased.length,
...@@ -266,7 +266,7 @@ const TxCompleteModal = () => { ...@@ -266,7 +266,7 @@ const TxCompleteModal = () => {
) : ( ) : (
// Only showing when all assets are unavailable // Only showing when all assets are unavailable
<Trace <Trace
name={EventName.NFT_BUY_BAG_REFUNDED} name={NFTEventName.NFT_BUY_BAG_REFUNDED}
properties={{ properties={{
buy_quantity: 0, buy_quantity: 0,
fail_quantity: nftsNotPurchased.length, fail_quantity: nftsNotPurchased.length,
......
import { useTrace } from '@uniswap/analytics' import { useTrace } from '@uniswap/analytics'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { NFTEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { OpacityHoverState } from 'components/Common' import { OpacityHoverState } from 'components/Common'
import { useNftBalance } from 'graphql/data/nft/NftBalance' import { useNftBalance } from 'graphql/data/nft/NftBalance'
...@@ -230,7 +230,7 @@ const OwnerContainer = ({ asset }: { asset: WalletAsset }) => { ...@@ -230,7 +230,7 @@ const OwnerContainer = ({ asset }: { asset: WalletAsset }) => {
resetSellAssets() resetSellAssets()
navigate('/nfts/profile') navigate('/nfts/profile')
selectSellAsset(asset) selectSellAsset(asset)
sendAnalyticsEvent(EventName.NFT_SELL_ITEM_ADDED, { sendAnalyticsEvent(NFTEventName.NFT_SELL_ITEM_ADDED, {
collection_address: asset.asset_contract.address, collection_address: asset.asset_contract.address,
token_id: asset.tokenId, token_id: asset.tokenId,
...trace, ...trace,
......
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, NFTEventName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { LoadingBubble } from 'components/Tokens/loading' import { LoadingBubble } from 'components/Tokens/loading'
import { useWindowSize } from 'hooks/useWindowSize' import { useWindowSize } from 'hooks/useWindowSize'
...@@ -189,9 +189,9 @@ export function Table<D extends Record<string, unknown>>({ ...@@ -189,9 +189,9 @@ export function Table<D extends Record<string, unknown>>({
return ( return (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.NFT_TRENDING_ROW_SELECTED} name={NFTEventName.NFT_TRENDING_ROW_SELECTED}
properties={{ collection_address: row.original.collection.address, chain_id: chainId }} properties={{ collection_address: row.original.collection.address, chain_id: chainId }}
element={ElementName.NFT_TRENDING_ROW} element={InterfaceElementName.NFT_TRENDING_ROW}
key={i} key={i}
> >
<StyledRow <StyledRow
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { useTrace } from '@uniswap/analytics' import { useTrace } from '@uniswap/analytics'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { NFTEventName } from '@uniswap/analytics-events'
import { MouseoverTooltip } from 'components/Tooltip' import { MouseoverTooltip } from 'components/Tooltip'
import Tooltip from 'components/Tooltip' import Tooltip from 'components/Tooltip'
import { NftStandard } from 'graphql/data/__generated__/types-and-hooks' import { NftStandard } from 'graphql/data/__generated__/types-and-hooks'
...@@ -77,7 +77,7 @@ export const ViewMyNftsAsset = ({ ...@@ -77,7 +77,7 @@ export const ViewMyNftsAsset = ({
removeSellAsset(asset) removeSellAsset(asset)
} else { } else {
selectSellAsset(asset) selectSellAsset(asset)
sendAnalyticsEvent(EventName.NFT_SELL_ITEM_ADDED, { sendAnalyticsEvent(NFTEventName.NFT_SELL_ITEM_ADDED, {
collection_address: asset.asset_contract.address, collection_address: asset.asset_contract.address,
token_id: asset.tokenId, token_id: asset.tokenId,
...trace, ...trace,
......
...@@ -4,7 +4,7 @@ import { hexStripZeros } from '@ethersproject/bytes' ...@@ -4,7 +4,7 @@ import { hexStripZeros } from '@ethersproject/bytes'
import { ContractReceipt } from '@ethersproject/contracts' import { ContractReceipt } from '@ethersproject/contracts'
import type { JsonRpcSigner } from '@ethersproject/providers' import type { JsonRpcSigner } from '@ethersproject/providers'
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { NFTEventName } from '@uniswap/analytics-events'
import create from 'zustand' import create from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
...@@ -50,7 +50,7 @@ export const useSendTransaction = create<TxState>()( ...@@ -50,7 +50,7 @@ export const useSendTransaction = create<TxState>()(
const res = await signer.sendTransaction(tx) const res = await signer.sendTransaction(tx)
set({ state: TxStateType.Confirming }) set({ state: TxStateType.Confirming })
set({ txHash: res.hash }) set({ txHash: res.hash })
sendAnalyticsEvent(EventName.NFT_BUY_BAG_SIGNED, { transaction_hash: res.hash }) sendAnalyticsEvent(NFTEventName.NFT_BUY_BAG_SIGNED, { transaction_hash: res.hash })
const txReceipt = await res.wait() const txReceipt = await res.wait()
......
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { useNftAssetDetails } from 'graphql/data/nft/Details' import { useNftAssetDetails } from 'graphql/data/nft/Details'
import { AssetDetails } from 'nft/components/details/AssetDetails' import { AssetDetails } from 'nft/components/details/AssetDetails'
import { AssetDetailsLoading } from 'nft/components/details/AssetDetailsLoading' import { AssetDetailsLoading } from 'nft/components/details/AssetDetailsLoading'
...@@ -45,7 +45,7 @@ const AssetPage = () => { ...@@ -45,7 +45,7 @@ const AssetPage = () => {
return ( return (
<> <>
<Trace <Trace
page={PageName.NFT_DETAILS_PAGE} page={InterfacePageName.NFT_DETAILS_PAGE}
properties={{ collection_address: contractAddress, token_id: tokenId }} properties={{ collection_address: contractAddress, token_id: tokenId }}
shouldLogImpression shouldLogImpression
> >
......
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import Column from 'components/Column' import Column from 'components/Column'
import { OpacityHoverState } from 'components/Common' import { OpacityHoverState } from 'components/Common'
...@@ -179,7 +179,7 @@ const Collection = () => { ...@@ -179,7 +179,7 @@ const Collection = () => {
return ( return (
<> <>
<Trace <Trace
page={PageName.NFT_COLLECTION_PAGE} page={InterfacePageName.NFT_COLLECTION_PAGE}
properties={{ collection_address: contractAddress, chain_id: chainId, is_activity_view: isActivityToggled }} properties={{ collection_address: contractAddress, chain_id: chainId, is_activity_view: isActivityToggled }}
shouldLogImpression shouldLogImpression
> >
......
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import Banner from 'nft/components/explore/Banner' import Banner from 'nft/components/explore/Banner'
import TrendingCollections from 'nft/components/explore/TrendingCollections' import TrendingCollections from 'nft/components/explore/TrendingCollections'
import { useBag } from 'nft/hooks' import { useBag } from 'nft/hooks'
...@@ -30,7 +30,7 @@ const NftExplore = () => { ...@@ -30,7 +30,7 @@ const NftExplore = () => {
return ( return (
<> <>
<Trace page={PageName.NFT_EXPLORE_PAGE} shouldLogImpression> <Trace page={InterfacePageName.NFT_EXPLORE_PAGE} shouldLogImpression>
<ExploreContainer> <ExploreContainer>
<Banner /> <Banner />
<TrendingCollections /> <TrendingCollections />
......
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Center, Column } from 'nft/components/Flex' import { Center, Column } from 'nft/components/Flex'
...@@ -44,7 +44,7 @@ const ProfileContent = () => { ...@@ -44,7 +44,7 @@ const ProfileContent = () => {
const cartExpanded = useBag((state) => state.bagExpanded) const cartExpanded = useBag((state) => state.bagExpanded)
return ( return (
<Trace page={PageName.NFT_PROFILE_PAGE} shouldLogImpression> <Trace page={InterfacePageName.NFT_PROFILE_PAGE} shouldLogImpression>
<Box className={styles.profileWrapper}> <Box className={styles.profileWrapper}>
{/* <Head> TODO: figure out metadata tagging {/* <Head> TODO: figure out metadata tagging
<title>Genie | Sell</title> <title>Genie | Sell</title>
......
...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber' ...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import type { TransactionResponse } from '@ethersproject/providers' import type { TransactionResponse } from '@ethersproject/providers'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core'
import { FeeAmount, NonfungiblePositionManager } from '@uniswap/v3-sdk' import { FeeAmount, NonfungiblePositionManager } from '@uniswap/v3-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
...@@ -442,9 +442,9 @@ export default function AddLiquidity() { ...@@ -442,9 +442,9 @@ export default function AddLiquidity() {
) : !account ? ( ) : !account ? (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.CONNECT_WALLET_BUTTON_CLICKED} name={InterfaceEventName.CONNECT_WALLET_BUTTON_CLICKED}
properties={{ received_swap_quote: false }} properties={{ received_swap_quote: false }}
element={ElementName.CONNECT_WALLET_BUTTON} element={InterfaceElementName.CONNECT_WALLET_BUTTON}
> >
<ButtonLight onClick={toggleWalletModal} $borderRadius="12px" padding="12px"> <ButtonLight onClick={toggleWalletModal} $borderRadius="12px" padding="12px">
<Trans>Connect Wallet</Trans> <Trans>Connect Wallet</Trans>
......
...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber' ...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import type { TransactionResponse } from '@ethersproject/providers' import type { TransactionResponse } from '@ethersproject/providers'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
...@@ -437,9 +437,9 @@ export default function AddLiquidity() { ...@@ -437,9 +437,9 @@ export default function AddLiquidity() {
) : !account ? ( ) : !account ? (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.CONNECT_WALLET_BUTTON_CLICKED} name={InterfaceEventName.CONNECT_WALLET_BUTTON_CLICKED}
properties={{ received_swap_quote: false }} properties={{ received_swap_quote: false }}
element={ElementName.CONNECT_WALLET_BUTTON} element={InterfaceElementName.CONNECT_WALLET_BUTTON}
> >
<ButtonLight onClick={toggleWalletModal}> <ButtonLight onClick={toggleWalletModal}>
<Trans>Connect Wallet</Trans> <Trans>Connect Wallet</Trans>
......
import { initializeAnalytics, OriginApplication, sendAnalyticsEvent, Trace, user } from '@uniswap/analytics' import { initializeAnalytics, OriginApplication, sendAnalyticsEvent, Trace, user } from '@uniswap/analytics'
import { CustomUserProperties, EventName, getBrowser, PageName } from '@uniswap/analytics-events' import { CustomUserProperties, getBrowser, InterfacePageName, SharedEventName } from '@uniswap/analytics-events'
import Loader from 'components/Loader' import Loader from 'components/Loader'
import { MenuDropdown } from 'components/NavBar/MenuDropdown' import { MenuDropdown } from 'components/NavBar/MenuDropdown'
import TopLevelModals from 'components/TopLevelModals' import TopLevelModals from 'components/TopLevelModals'
...@@ -54,7 +54,7 @@ const ANALYTICS_PROXY_URL = process.env.REACT_APP_AMPLITUDE_PROXY_URL ...@@ -54,7 +54,7 @@ const ANALYTICS_PROXY_URL = process.env.REACT_APP_AMPLITUDE_PROXY_URL
const COMMIT_HASH = process.env.REACT_APP_GIT_COMMIT_HASH const COMMIT_HASH = process.env.REACT_APP_GIT_COMMIT_HASH
initializeAnalytics(ANALYTICS_DUMMY_KEY, OriginApplication.INTERFACE, { initializeAnalytics(ANALYTICS_DUMMY_KEY, OriginApplication.INTERFACE, {
proxyUrl: ANALYTICS_PROXY_URL, proxyUrl: ANALYTICS_PROXY_URL,
defaultEventName: EventName.PAGE_VIEWED, defaultEventName: SharedEventName.PAGE_VIEWED,
commitHash: COMMIT_HASH, commitHash: COMMIT_HASH,
isProductionEnv: isProductionEnv(), isProductionEnv: isProductionEnv(),
}) })
...@@ -99,24 +99,24 @@ const HeaderWrapper = styled.div<{ transparent?: boolean }>` ...@@ -99,24 +99,24 @@ const HeaderWrapper = styled.div<{ transparent?: boolean }>`
z-index: ${Z_INDEX.dropdown}; z-index: ${Z_INDEX.dropdown};
` `
function getCurrentPageFromLocation(locationPathname: string): PageName | undefined { function getCurrentPageFromLocation(locationPathname: string): InterfacePageName | undefined {
switch (true) { switch (true) {
case locationPathname.startsWith('/swap'): case locationPathname.startsWith('/swap'):
return PageName.SWAP_PAGE return InterfacePageName.SWAP_PAGE
case locationPathname.startsWith('/vote'): case locationPathname.startsWith('/vote'):
return PageName.VOTE_PAGE return InterfacePageName.VOTE_PAGE
case locationPathname.startsWith('/pool'): case locationPathname.startsWith('/pool'):
return PageName.POOL_PAGE return InterfacePageName.POOL_PAGE
case locationPathname.startsWith('/tokens'): case locationPathname.startsWith('/tokens'):
return PageName.TOKENS_PAGE return InterfacePageName.TOKENS_PAGE
case locationPathname.startsWith('/nfts/profile'): case locationPathname.startsWith('/nfts/profile'):
return PageName.NFT_PROFILE_PAGE return InterfacePageName.NFT_PROFILE_PAGE
case locationPathname.startsWith('/nfts/asset'): case locationPathname.startsWith('/nfts/asset'):
return PageName.NFT_DETAILS_PAGE return InterfacePageName.NFT_DETAILS_PAGE
case locationPathname.startsWith('/nfts/collection'): case locationPathname.startsWith('/nfts/collection'):
return PageName.NFT_COLLECTION_PAGE return InterfacePageName.NFT_COLLECTION_PAGE
case locationPathname.startsWith('/nfts'): case locationPathname.startsWith('/nfts'):
return PageName.NFT_EXPLORE_PAGE return InterfacePageName.NFT_EXPLORE_PAGE
default: default:
return undefined return undefined
} }
...@@ -153,15 +153,17 @@ export default function App() { ...@@ -153,15 +153,17 @@ export default function App() {
}, [pathname]) }, [pathname])
useEffect(() => { useEffect(() => {
sendAnalyticsEvent(EventName.APP_LOADED) sendAnalyticsEvent(SharedEventName.APP_LOADED)
user.set(CustomUserProperties.USER_AGENT, navigator.userAgent) user.set(CustomUserProperties.USER_AGENT, navigator.userAgent)
user.set(CustomUserProperties.BROWSER, getBrowser()) user.set(CustomUserProperties.BROWSER, getBrowser())
user.set(CustomUserProperties.SCREEN_RESOLUTION_HEIGHT, window.screen.height) user.set(CustomUserProperties.SCREEN_RESOLUTION_HEIGHT, window.screen.height)
user.set(CustomUserProperties.SCREEN_RESOLUTION_WIDTH, window.screen.width) user.set(CustomUserProperties.SCREEN_RESOLUTION_WIDTH, window.screen.width)
getCLS(({ delta }: Metric) => sendAnalyticsEvent(EventName.WEB_VITALS, { cumulative_layout_shift: delta })) getCLS(({ delta }: Metric) => sendAnalyticsEvent(SharedEventName.WEB_VITALS, { cumulative_layout_shift: delta }))
getFCP(({ delta }: Metric) => sendAnalyticsEvent(EventName.WEB_VITALS, { first_contentful_paint_ms: delta })) getFCP(({ delta }: Metric) => sendAnalyticsEvent(SharedEventName.WEB_VITALS, { first_contentful_paint_ms: delta }))
getFID(({ delta }: Metric) => sendAnalyticsEvent(EventName.WEB_VITALS, { first_input_delay_ms: delta })) getFID(({ delta }: Metric) => sendAnalyticsEvent(SharedEventName.WEB_VITALS, { first_input_delay_ms: delta }))
getLCP(({ delta }: Metric) => sendAnalyticsEvent(EventName.WEB_VITALS, { largest_contentful_paint_ms: delta })) getLCP(({ delta }: Metric) =>
sendAnalyticsEvent(SharedEventName.WEB_VITALS, { largest_contentful_paint_ms: delta })
)
}, []) }, [])
useEffect(() => { useEffect(() => {
......
...@@ -2,7 +2,7 @@ import { defaultAbiCoder } from '@ethersproject/abi' ...@@ -2,7 +2,7 @@ import { defaultAbiCoder } from '@ethersproject/abi'
import { getAddress, isAddress } from '@ethersproject/address' import { getAddress, isAddress } from '@ethersproject/address'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { ButtonError } from 'components/Button' import { ButtonError } from 'components/Button'
...@@ -239,7 +239,7 @@ ${bodyValue} ...@@ -239,7 +239,7 @@ ${bodyValue}
} }
return ( return (
<Trace page={PageName.VOTE_PAGE} shouldLogImpression> <Trace page={InterfacePageName.VOTE_PAGE} shouldLogImpression>
<PageWrapper> <PageWrapper>
<AppBody $maxWidth="800px"> <AppBody $maxWidth="800px">
<CreateProposalTabs /> <CreateProposalTabs />
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace, TraceEvent } from '@uniswap/analytics' import { Trace, TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfacePageName, SharedEventName } from '@uniswap/analytics-events'
import { AboutFooter } from 'components/About/AboutFooter' import { AboutFooter } from 'components/About/AboutFooter'
import Card, { CardType } from 'components/About/Card' import Card, { CardType } from 'components/About/Card'
import { MAIN_CARDS, MORE_CARDS } from 'components/About/constants' import { MAIN_CARDS, MORE_CARDS } from 'components/About/constants'
...@@ -297,14 +297,14 @@ export default function Landing() { ...@@ -297,14 +297,14 @@ export default function Landing() {
}, [navigate, selectedWallet, queryParams.intro]) }, [navigate, selectedWallet, queryParams.intro])
return ( return (
<Trace page={PageName.LANDING_PAGE} shouldLogImpression> <Trace page={InterfacePageName.LANDING_PAGE} shouldLogImpression>
{showContent && ( {showContent && (
<PageContainer isDarkMode={isDarkMode} data-testid="landing-page"> <PageContainer isDarkMode={isDarkMode} data-testid="landing-page">
<LandingSwapContainer> <LandingSwapContainer>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.ELEMENT_CLICKED} name={SharedEventName.ELEMENT_CLICKED}
element={ElementName.LANDING_PAGE_SWAP_ELEMENT} element={InterfaceElementName.LANDING_PAGE_SWAP_ELEMENT}
> >
<Link to="/swap"> <Link to="/swap">
<LandingSwap /> <LandingSwap />
...@@ -323,8 +323,8 @@ export default function Landing() { ...@@ -323,8 +323,8 @@ export default function Landing() {
<ActionsContainer> <ActionsContainer>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.ELEMENT_CLICKED} name={SharedEventName.ELEMENT_CLICKED}
element={ElementName.CONTINUE_BUTTON} element={InterfaceElementName.CONTINUE_BUTTON}
> >
<ButtonCTA as={Link} to="/swap"> <ButtonCTA as={Link} to="/swap">
<ButtonCTAText>Get started</ButtonCTAText> <ButtonCTAText>Get started</ButtonCTAText>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { InterfacePageName } from '@uniswap/analytics-events'
import { SmallButtonPrimary } from 'components/Button' import { SmallButtonPrimary } from 'components/Button'
import { useIsMobile } from 'nft/hooks' import { useIsMobile } from 'nft/hooks'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
...@@ -46,7 +47,7 @@ export default function NotFound() { ...@@ -46,7 +47,7 @@ export default function NotFound() {
return ( return (
<PageWrapper> <PageWrapper>
<Trace page="404-page" shouldLogImpression> <Trace page={InterfacePageName.NOT_FOUND} shouldLogImpression>
<Header> <Header>
<Container> <Container>
<Title>404</Title> <Title>404</Title>
......
...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber' ...@@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber'
import type { TransactionResponse } from '@ethersproject/providers' import type { TransactionResponse } from '@ethersproject/providers'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Fraction, Percent, Price, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Fraction, Percent, Price, Token } from '@uniswap/sdk-core'
import { NonfungiblePositionManager, Pool, Position } from '@uniswap/v3-sdk' import { NonfungiblePositionManager, Pool, Position } from '@uniswap/v3-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
...@@ -582,7 +582,7 @@ export function PositionPage() { ...@@ -582,7 +582,7 @@ export function PositionPage() {
<div /> <div />
</LoadingRows> </LoadingRows>
) : ( ) : (
<Trace page={PageName.POOL_PAGE} shouldLogImpression> <Trace page={InterfacePageName.POOL_PAGE} shouldLogImpression>
<> <>
<PageWrapper> <PageWrapper>
<TransactionConfirmationModal <TransactionConfirmationModal
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace, TraceEvent } from '@uniswap/analytics' import { Trace, TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName, InterfacePageName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { ButtonGray, ButtonPrimary, ButtonText } from 'components/Button' import { ButtonGray, ButtonPrimary, ButtonText } from 'components/Button'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
...@@ -262,7 +262,7 @@ export default function Pool() { ...@@ -262,7 +262,7 @@ export default function Pool() {
] ]
return ( return (
<Trace page={PageName.POOL_PAGE} shouldLogImpression> <Trace page={InterfacePageName.POOL_PAGE} shouldLogImpression>
<PageWrapper> <PageWrapper>
<AutoColumn gap="lg" justify="center"> <AutoColumn gap="lg" justify="center">
<AutoColumn gap="lg" style={{ width: '100%' }}> <AutoColumn gap="lg" style={{ width: '100%' }}>
...@@ -319,9 +319,9 @@ export default function Pool() { ...@@ -319,9 +319,9 @@ export default function Pool() {
{showConnectAWallet && ( {showConnectAWallet && (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.CONNECT_WALLET_BUTTON_CLICKED} name={InterfaceEventName.CONNECT_WALLET_BUTTON_CLICKED}
properties={{ received_swap_quote: false }} properties={{ received_swap_quote: false }}
element={ElementName.CONNECT_WALLET_BUTTON} element={InterfaceElementName.CONNECT_WALLET_BUTTON}
> >
<ButtonPrimary <ButtonPrimary
style={{ marginTop: '2em', marginBottom: '2em', padding: '8px 16px' }} style={{ marginTop: '2em', marginBottom: '2em', padding: '8px 16px' }}
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { UNSUPPORTED_V2POOL_CHAIN_IDS } from 'constants/chains' import { UNSUPPORTED_V2POOL_CHAIN_IDS } from 'constants/chains'
...@@ -140,7 +140,7 @@ export default function Pool() { ...@@ -140,7 +140,7 @@ export default function Pool() {
}) })
return ( return (
<Trace page={PageName.POOL_PAGE} shouldLogImpression> <Trace page={InterfacePageName.POOL_PAGE} shouldLogImpression>
<> <>
<PageWrapper> <PageWrapper>
<VoteCard> <VoteCard>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import JSBI from 'jsbi' import JSBI from 'jsbi'
...@@ -97,7 +97,7 @@ export default function PoolFinder() { ...@@ -97,7 +97,7 @@ export default function PoolFinder() {
) )
return ( return (
<Trace page={PageName.POOL_PAGE} shouldLogImpression> <Trace page={InterfacePageName.POOL_PAGE} shouldLogImpression>
<> <>
<AppBody> <AppBody>
<FindPoolTabs origin={query.get('origin') ?? '/pool/v2'} /> <FindPoolTabs origin={query.get('origin') ?? '/pool/v2'} />
......
...@@ -3,7 +3,7 @@ import { Contract } from '@ethersproject/contracts' ...@@ -3,7 +3,7 @@ import { Contract } from '@ethersproject/contracts'
import type { TransactionResponse } from '@ethersproject/providers' import type { TransactionResponse } from '@ethersproject/providers'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { TraceEvent } from '@uniswap/analytics' import { TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName } from '@uniswap/analytics-events' import { BrowserEvent, InterfaceElementName, InterfaceEventName } from '@uniswap/analytics-events'
import { Currency, Percent } from '@uniswap/sdk-core' import { Currency, Percent } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
...@@ -626,9 +626,9 @@ export default function RemoveLiquidity() { ...@@ -626,9 +626,9 @@ export default function RemoveLiquidity() {
{!account ? ( {!account ? (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.CONNECT_WALLET_BUTTON_CLICKED} name={InterfaceEventName.CONNECT_WALLET_BUTTON_CLICKED}
properties={{ received_swap_quote: false }} properties={{ received_swap_quote: false }}
element={ElementName.CONNECT_WALLET_BUTTON} element={InterfaceElementName.CONNECT_WALLET_BUTTON}
> >
<ButtonLight onClick={toggleWalletModal}> <ButtonLight onClick={toggleWalletModal}>
<Trans>Connect Wallet</Trans> <Trans>Connect Wallet</Trans>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { sendAnalyticsEvent, Trace, TraceEvent } from '@uniswap/analytics' import { sendAnalyticsEvent, Trace, TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, ElementName, EventName, PageName, SectionName } from '@uniswap/analytics-events' import {
BrowserEvent,
InterfaceElementName,
InterfaceEventName,
InterfacePageName,
InterfaceSectionName,
SwapEventName,
} from '@uniswap/analytics-events'
import { Trade } from '@uniswap/router-sdk' import { Trade } from '@uniswap/router-sdk'
import { Currency, CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core'
import { UNIVERSAL_ROUTER_ADDRESS } from '@uniswap/universal-router-sdk' import { UNIVERSAL_ROUTER_ADDRESS } from '@uniswap/universal-router-sdk'
...@@ -308,7 +315,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -308,7 +315,7 @@ export default function Swap({ className }: { className?: string }) {
try { try {
const approval = await permit.callback?.() const approval = await permit.callback?.()
if (approval) { if (approval) {
sendAnalyticsEvent(EventName.APPROVE_TOKEN_TXN_SUBMITTED, { sendAnalyticsEvent(InterfaceEventName.APPROVE_TOKEN_TXN_SUBMITTED, {
chain_id: chainId, chain_id: chainId,
token_symbol: maximumAmountIn?.currency.symbol, token_symbol: maximumAmountIn?.currency.symbol,
token_address: maximumAmountIn?.currency.address, token_address: maximumAmountIn?.currency.address,
...@@ -510,7 +517,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -510,7 +517,7 @@ export default function Swap({ className }: { className?: string }) {
setSwapQuoteReceivedDate(now) setSwapQuoteReceivedDate(now)
// Log swap quote. // Log swap quote.
sendAnalyticsEvent( sendAnalyticsEvent(
EventName.SWAP_QUOTE_RECEIVED, SwapEventName.SWAP_QUOTE_RECEIVED,
formatSwapQuoteReceivedEventProperties(trade, trade.gasUseEstimateUSD ?? undefined, fetchingSwapQuoteStartTime) formatSwapQuoteReceivedEventProperties(trade, trade.gasUseEstimateUSD ?? undefined, fetchingSwapQuoteStartTime)
) )
// Latest swap quote has just been logged, so we don't need to log the current trade anymore // Latest swap quote has just been logged, so we don't need to log the current trade anymore
...@@ -541,7 +548,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -541,7 +548,7 @@ export default function Swap({ className }: { className?: string }) {
) )
return ( return (
<Trace page={PageName.SWAP_PAGE} shouldLogImpression> <Trace page={InterfacePageName.SWAP_PAGE} shouldLogImpression>
<> <>
<TokenSafetyModal <TokenSafetyModal
isOpen={importTokensNotInDefault.length > 0 && !dismissTokenWarning} isOpen={importTokensNotInDefault.length > 0 && !dismissTokenWarning}
...@@ -573,7 +580,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -573,7 +580,7 @@ export default function Swap({ className }: { className?: string }) {
<div style={{ display: 'relative' }}> <div style={{ display: 'relative' }}>
<SwapSection> <SwapSection>
<Trace section={SectionName.CURRENCY_INPUT_PANEL}> <Trace section={InterfaceSectionName.CURRENCY_INPUT_PANEL}>
<SwapCurrencyInputPanel <SwapCurrencyInputPanel
label={ label={
independentField === Field.OUTPUT && !showWrap ? ( independentField === Field.OUTPUT && !showWrap ? (
...@@ -591,7 +598,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -591,7 +598,7 @@ export default function Swap({ className }: { className?: string }) {
onCurrencySelect={handleInputSelect} onCurrencySelect={handleInputSelect}
otherCurrency={currencies[Field.OUTPUT]} otherCurrency={currencies[Field.OUTPUT]}
showCommonBases={true} showCommonBases={true}
id={SectionName.CURRENCY_INPUT_PANEL} id={InterfaceSectionName.CURRENCY_INPUT_PANEL}
loading={independentField === Field.OUTPUT && routeIsSyncing} loading={independentField === Field.OUTPUT && routeIsSyncing}
/> />
</Trace> </Trace>
...@@ -599,8 +606,8 @@ export default function Swap({ className }: { className?: string }) { ...@@ -599,8 +606,8 @@ export default function Swap({ className }: { className?: string }) {
<ArrowWrapper clickable={isSupportedChain(chainId)}> <ArrowWrapper clickable={isSupportedChain(chainId)}>
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.SWAP_TOKENS_REVERSED} name={SwapEventName.SWAP_TOKENS_REVERSED}
element={ElementName.SWAP_TOKENS_REVERSE_ARROW_BUTTON} element={InterfaceElementName.SWAP_TOKENS_REVERSE_ARROW_BUTTON}
> >
<ArrowContainer <ArrowContainer
onClick={() => { onClick={() => {
...@@ -622,7 +629,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -622,7 +629,7 @@ export default function Swap({ className }: { className?: string }) {
<AutoColumn gap="md"> <AutoColumn gap="md">
<div> <div>
<OutputSwapSection showDetailsDropdown={showDetailsDropdown}> <OutputSwapSection showDetailsDropdown={showDetailsDropdown}>
<Trace section={SectionName.CURRENCY_OUTPUT_PANEL}> <Trace section={InterfaceSectionName.CURRENCY_OUTPUT_PANEL}>
<SwapCurrencyInputPanel <SwapCurrencyInputPanel
value={formattedAmounts[Field.OUTPUT]} value={formattedAmounts[Field.OUTPUT]}
onUserInput={handleTypeOutput} onUserInput={handleTypeOutput}
...@@ -637,7 +644,7 @@ export default function Swap({ className }: { className?: string }) { ...@@ -637,7 +644,7 @@ export default function Swap({ className }: { className?: string }) {
onCurrencySelect={handleOutputSelect} onCurrencySelect={handleOutputSelect}
otherCurrency={currencies[Field.INPUT]} otherCurrency={currencies[Field.INPUT]}
showCommonBases={true} showCommonBases={true}
id={SectionName.CURRENCY_OUTPUT_PANEL} id={InterfaceSectionName.CURRENCY_OUTPUT_PANEL}
loading={independentField === Field.INPUT && routeIsSyncing} loading={independentField === Field.INPUT && routeIsSyncing}
/> />
</Trace> </Trace>
...@@ -678,9 +685,9 @@ export default function Swap({ className }: { className?: string }) { ...@@ -678,9 +685,9 @@ export default function Swap({ className }: { className?: string }) {
) : !account ? ( ) : !account ? (
<TraceEvent <TraceEvent
events={[BrowserEvent.onClick]} events={[BrowserEvent.onClick]}
name={EventName.CONNECT_WALLET_BUTTON_CLICKED} name={InterfaceEventName.CONNECT_WALLET_BUTTON_CLICKED}
properties={{ received_swap_quote: getIsValidSwapQuote(trade, tradeState, swapInputError) }} properties={{ received_swap_quote: getIsValidSwapQuote(trade, tradeState, swapInputError) }}
element={ElementName.CONNECT_WALLET_BUTTON} element={InterfaceElementName.CONNECT_WALLET_BUTTON}
> >
<ButtonLight onClick={toggleWalletModal} fontWeight={600}> <ButtonLight onClick={toggleWalletModal} fontWeight={600}>
<Trans>Connect Wallet</Trans> <Trans>Connect Wallet</Trans>
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { MAX_WIDTH_MEDIA_BREAKPOINT, MEDIUM_MEDIA_BREAKPOINT } from 'components/Tokens/constants' import { MAX_WIDTH_MEDIA_BREAKPOINT, MEDIUM_MEDIA_BREAKPOINT } from 'components/Tokens/constants'
import { filterStringAtom } from 'components/Tokens/state' import { filterStringAtom } from 'components/Tokens/state'
...@@ -94,7 +94,7 @@ const Tokens = () => { ...@@ -94,7 +94,7 @@ const Tokens = () => {
}) })
return ( return (
<Trace page={PageName.TOKENS_PAGE} shouldLogImpression> <Trace page={InterfacePageName.TOKENS_PAGE} shouldLogImpression>
<ExploreContainer> <ExploreContainer>
<TitleContainer> <TitleContainer>
<MouseoverTooltip <MouseoverTooltip
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { CurrencyAmount, Token } from '@uniswap/sdk-core' import { CurrencyAmount, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { ButtonPrimary } from 'components/Button' import { ButtonPrimary } from 'components/Button'
...@@ -145,7 +145,7 @@ export default function Landing() { ...@@ -145,7 +145,7 @@ export default function Landing() {
) )
return ( return (
<> <>
<Trace page={PageName.VOTE_PAGE} shouldLogImpression> <Trace page={InterfacePageName.VOTE_PAGE} shouldLogImpression>
<PageWrapper gap="lg" justify="center"> <PageWrapper gap="lg" justify="center">
<DelegateModal <DelegateModal
isOpen={showDelegateModal} isOpen={showDelegateModal}
......
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Trace } from '@uniswap/analytics' import { Trace } from '@uniswap/analytics'
import { PageName } from '@uniswap/analytics-events' import { InterfacePageName } from '@uniswap/analytics-events'
import { CurrencyAmount, Fraction, Token } from '@uniswap/sdk-core' import { CurrencyAmount, Fraction, Token } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import ExecuteModal from 'components/vote/ExecuteModal' import ExecuteModal from 'components/vote/ExecuteModal'
...@@ -271,7 +271,7 @@ export default function VotePage() { ...@@ -271,7 +271,7 @@ export default function VotePage() {
} }
return ( return (
<Trace page={PageName.VOTE_PAGE} shouldLogImpression> <Trace page={InterfacePageName.VOTE_PAGE} shouldLogImpression>
<> <>
<PageWrapper gap="lg" justify="center"> <PageWrapper gap="lg" justify="center">
<VoteModal <VoteModal
......
import { sendAnalyticsEvent } from '@uniswap/analytics' import { sendAnalyticsEvent } from '@uniswap/analytics'
import { EventName } from '@uniswap/analytics-events' import { SwapEventName } from '@uniswap/analytics-events'
import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Currency, Percent, TradeType } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { DEFAULT_TXN_DISMISS_MS, L2_TXN_DISMISS_MS } from 'constants/misc' import { DEFAULT_TXN_DISMISS_MS, L2_TXN_DISMISS_MS } from 'constants/misc'
...@@ -83,7 +83,7 @@ export default function Updater() { ...@@ -83,7 +83,7 @@ export default function Updater() {
if (tx.info.type === TransactionType.SWAP && trade) { if (tx.info.type === TransactionType.SWAP && trade) {
sendAnalyticsEvent( sendAnalyticsEvent(
EventName.SWAP_TRANSACTION_COMPLETED, SwapEventName.SWAP_TRANSACTION_COMPLETED,
formatAnalyticsEventProperties({ formatAnalyticsEventProperties({
trade, trade,
hash, hash,
......
...@@ -4921,10 +4921,10 @@ ...@@ -4921,10 +4921,10 @@
"@typescript-eslint/types" "5.47.0" "@typescript-eslint/types" "5.47.0"
eslint-visitor-keys "^3.3.0" eslint-visitor-keys "^3.3.0"
"@uniswap/analytics-events@^1.5.0": "@uniswap/analytics-events@2.1.0":
version "1.5.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/@uniswap/analytics-events/-/analytics-events-1.5.0.tgz#1f5a6e0fedb46e551745c2b4d2b791fe44964cfa" resolved "https://registry.yarnpkg.com/@uniswap/analytics-events/-/analytics-events-2.1.0.tgz#0a112f642d0121fdf69b5dc9a17639f06aa63085"
integrity sha512-grrPk71hoBeXiBivlqgeh97lY7TmKEYhzzOLXdMXjXX/mcGOM9HLV0XR1olr/WPwuhBFx9GefaiB3GJU9+/sOQ== integrity sha512-HkWyri7PxnIS6B5sysym1LCMPnenkeAFyI41fYGDUNq3a5aEDuD77jyyFSwdW4yZfUOxq3zBUTmeQOIf/GT+tQ==
"@uniswap/analytics@1.2.0": "@uniswap/analytics@1.2.0":
version "1.2.0" version "1.2.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment