This commit is contained in:
github-actions[bot] 2022-10-09 22:03:20 +00:00 committed by GitHub
commit 8984aae42f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import { CPMMBinaryContract } from 'common/contract'
import { Customize, USAMap } from './usa-map'
import { listenForContract } from 'web/lib/firebase/contracts'
import { interpolateColor } from 'common/util/color'
import { track } from 'web/lib/service/analytics'
export interface StateElectionMarket {
creatorUsername: string
@ -35,8 +36,13 @@ export function StateElectionMap(props: {
market.state,
{
fill: probToColor(prob, market.isWinRepublican),
clickHandler: () =>
Router.push(`/${market.creatorUsername}/${market.slug}`),
clickHandler: () => {
Router.push(`/${market.creatorUsername}/${market.slug}`)
track('state election map click', {
state: market.state,
slug: market.slug,
})
},
},
])

View File

@ -14,6 +14,7 @@ import { getUser, User } from 'web/lib/firebase/users'
import { DateDocPost } from './[username]'
import { NoSEO } from 'web/components/NoSEO'
import { useDateDocs } from 'web/hooks/use-post'
import { useTracking } from 'web/hooks/use-tracking'
export async function getStaticProps() {
const dateDocs = await getDateDocs()
@ -40,6 +41,7 @@ export default function DatePage(props: {
const dateDocs = useDateDocs() ?? props.dateDocs
const hasDoc = dateDocs.some((d) => d.creatorId === user?.id)
useTracking('view date docs page')
return (
<Page>

View File

@ -8,6 +8,7 @@ import {
StateElectionMarket,
StateElectionMap,
} from 'web/components/usa-map/state-election-map'
import { useTracking } from 'web/hooks/use-tracking'
import { getContractFromSlug } from 'web/lib/firebase/contracts'
const senateMidterms: StateElectionMarket[] = [
@ -203,6 +204,8 @@ const App = (props: {
}) => {
const { senateContracts, governorContracts } = props
useTracking('view midterms 2022')
return (
<Page className="">
<Col className="items-center justify-center">