diff --git a/web/components/challenges/create-challenge-modal.tsx b/web/components/challenges/create-challenge-modal.tsx index eca50f27..e93ec314 100644 --- a/web/components/challenges/create-challenge-modal.tsx +++ b/web/components/challenges/create-challenge-modal.tsx @@ -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} /> diff --git a/web/components/contract/share-row.tsx b/web/components/contract/share-row.tsx index fa86094f..9c8c1573 100644 --- a/web/components/contract/share-row.tsx +++ b/web/components/contract/share-row.tsx @@ -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: {