challenge bet tracking

This commit is contained in:
mantikoros 2022-08-05 13:42:02 -07:00
parent f11c9a3341
commit 5e89628593
2 changed files with 14 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import { QRCode } from '../qr-code'
import { copyToClipboard } from 'web/lib/util/copy'
import { AmountInput } from '../amount-input'
import { getProbability } from 'common/calculate'
import { track } from 'web/lib/service/analytics'
type challengeInfo = {
amount: number
@ -55,7 +56,14 @@ export function CreateChallengeModal(props: {
outcome: newChallenge.outcome,
contract: contract,
})
challenge && setChallengeSlug(getChallengeUrl(challenge))
if (challenge) {
setChallengeSlug(getChallengeUrl(challenge))
track('challenge created', {
creator: user.username,
amount: newChallenge.amount,
contractId: contract.id,
})
}
}}
challengeSlug={challengeSlug}
/>

View File

@ -9,6 +9,7 @@ import { CreateChallengeModal } from '../challenges/create-challenge-modal'
import { User } from 'common/user'
import { CHALLENGES_ENABLED } from 'common/challenge'
import { ShareModal } from './share-modal'
import { withTracking } from 'web/lib/service/analytics'
export function ShareRow(props: {
contract: Contract
@ -47,7 +48,10 @@ export function ShareRow(props: {
<Button
size="lg"
color="gray-white"
onClick={() => setIsOpen(true)}
onClick={withTracking(
() => setIsOpen(true),
'click challenge button'
)}
className="animate-bounce"
>
Challenge