Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(onboarding): track team creation and skip events (#3068)
Evan Hutnik513d4787b2c8
diff --git a/js/app/packages/app/component/interactive-onboarding/lessons/invite-team.tsx b/js/app/packages/app/component/interactive-onboarding/lessons/invite-team.tsxindex d81562af05..77893d0415 100644--- a/js/app/packages/app/component/interactive-onboarding/lessons/invite-team.tsx+++ b/js/app/packages/app/component/interactive-onboarding/lessons/invite-team.tsx@@ -17,6 +17,7 @@ import {useCreateTeamWithInvitesMutation,} from '@queries/team';import { useEmail } from '@core/context/user';+import { useAnalytics } from '@app/component/analytics-context';import type { LessonContentProps, LessonDefinition } from '../types';const inviteFormSchema = z.object({@@ -47,6 +48,7 @@ type FormErrors = {};function InviteTeamDemo(props: LessonContentProps) {+ const analytics = useAnalytics();const [teamName, setTeamName] = createSignal('');const [emails, setEmails] = createSignal<string[]>(['']);const [errors, setErrors] = createSignal<FormErrors>({});@@ -198,6 +200,9 @@ function InviteTeamDemo(props: LessonContentProps) {name: result.data.teamName,emails: result.data.emails.length > 0 ? result.data.emails : undefined,});+ analytics.track('onboarding_team_created', {+ inviteCount: result.data.emails.length,+ });props.advance();} catch {// Error is displayed in the form via createTeamMutation.error@@ -364,10 +369,14 @@ function InviteTeamDemo(props: LessonContentProps) {}function SkipAction(props: LessonContentProps) {+ const analytics = useAnalytics();return (<buttontype="button"- onClick={() => props.advance()}+ onClick={() => {+ analytics.track('onboarding_team_skipped');+ props.advance();+ }}class="w-full px-3 py-2.5 text-lg rounded-xs flex items-center justify-between text-ink/40 hover:text-ink hover:bg-ink/5 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-panel">Skip for nowdiff --git a/js/app/packages/app/lib/analytics/app-events.ts b/js/app/packages/app/lib/analytics/app-events.tsindex 6f970ef821..f37c81bffe 100644--- a/js/app/packages/app/lib/analytics/app-events.ts+++ b/js/app/packages/app/lib/analytics/app-events.ts@@ -8,6 +8,8 @@ export type AppEvents = {login_from_onboarding: Record<string, unknown>;mobile_web_welcome_viewed: Record<string, unknown>;mobile_web_signup_sent_viewed: Record<string, unknown>;+ onboarding_team_created: { inviteCount: number };+ onboarding_team_skipped: Record<string, unknown>;subscription_start: Record<string, unknown>;subscription_cancel: Record<string, unknown>;