diff --git a/web/hooks/use-notifications.ts b/web/hooks/use-notifications.ts index 051d6cbb..c947e8d0 100644 --- a/web/hooks/use-notifications.ts +++ b/web/hooks/use-notifications.ts @@ -117,7 +117,7 @@ function getAppropriateNotifications( return notifications.filter( (n) => n.reason && - // Show all contract notifications + // Show all contract notifications and any that aren't in the above list: (n.sourceType === 'contract' || !lessPriorityReasons.includes(n.reason)) ) if (notificationPreferences === 'none') return [] diff --git a/web/lib/firebase/users.ts b/web/lib/firebase/users.ts index 4570a757..eae59b9e 100644 --- a/web/lib/firebase/users.ts +++ b/web/lib/firebase/users.ts @@ -34,6 +34,7 @@ import { filterDefined } from 'common/util/array' import { addUserToGroupViaSlug } from 'web/lib/firebase/groups' import { removeUndefinedProps } from 'common/util/object' import dayjs from 'dayjs' +import { track } from '@amplitude/analytics-browser' export type { User } @@ -154,9 +155,18 @@ async function setCachedReferralInfoForUser(user: User | null) { ? cachedReferralContractId : undefined, }) - ).catch((err) => { - console.log('error setting referral details', err) - }) + ) + .catch((err) => { + console.log('error setting referral details', err) + }) + .then(() => { + track('Referral', { + userId: user.id, + referredByUserId: referredByUser.id, + referredByContractId: cachedReferralContractId, + referredByGroupSlug: cachedReferralGroupSlug, + }) + }) }) if (cachedReferralGroupSlug) diff --git a/web/pages/notifications.tsx b/web/pages/notifications.tsx index 157a553f..9b0216b6 100644 --- a/web/pages/notifications.tsx +++ b/web/pages/notifications.tsx @@ -280,6 +280,7 @@ function NotificationGroupItem(props: { ) } +// TODO: where should we put referral bonus notifications? function NotificationSettings() { const user = useUser() const [notificationSettings, setNotificationSettings] = @@ -429,6 +430,10 @@ function NotificationSettings() { highlight={notificationSettings !== 'none'} label={"Activity on questions you're betting on"} /> +