AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
refactor(frontend): stop sending in-app events to DataFast (#15851)
Krzysztof Czerwinski379862d32774
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.tsindex d0f37e1e51..e091d6a73e 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/tracking.test.ts@@ -1,13 +1,5 @@import { beforeEach, describe, expect, it, vi } from "vitest";-const { sendDatafastEvent } = vi.hoisted(() => ({- sendDatafastEvent: vi.fn(),-}));--vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));-const { posthog } = vi.hoisted(() => ({posthog: { __loaded: true, is_capturing: () => true, capture: vi.fn() },}));@@ -58,7 +50,7 @@ describe("onboardingStepKey", () => {expect(onboardingStepKey(steps, 7)).toBe("preparing");});- // The paywall reports itself as `paywall_view`; reporting it again here would+ // The paywall reports itself as `paywall_viewed`; reporting it again here would// double-count the top of the funnel.it("returns null for the subscription step", () => {expect(@@ -69,14 +61,10 @@ describe("onboardingStepKey", () => {describe("trackOnboardingStep", () => {beforeEach(() => {- vi.restoreAllMocks();- sendDatafastEvent.mockReset();posthog.capture.mockReset();sessionStorage.clear();});- // PostHog gets one event with the step as a property; DataFast keeps its- // goal per step.it("reports each step to PostHog once, as onboarding_step_viewed", () => {trackOnboardingStep("role");trackOnboardingStep("role");@@ -88,78 +76,19 @@ describe("trackOnboardingStep", () => {]);});- it("still reports to PostHog when the DataFast script throws", () => {- sendDatafastEvent.mockImplementation(() => {- throw new Error("datafast unavailable");- });-- trackOnboardingStep("team");-- expect(posthog.capture).toHaveBeenCalledWith("onboarding_step_viewed", {- step: "team",- });- });-- it("reports one goal per step name", () => {- trackOnboardingStep("role");- trackOnboardingStep("pain_points");-- expect(sendDatafastEvent).toHaveBeenNthCalledWith(1, "onboarding_role", {});- expect(sendDatafastEvent).toHaveBeenNthCalledWith(- 2,- "onboarding_pain_points",- {},- );- });-- it("reports each step at most once per session", () => {- trackOnboardingStep("role");- trackOnboardingStep("role");-- expect(sendDatafastEvent).toHaveBeenCalledTimes(1);- });-- it("does not let one step suppress another", () => {- trackOnboardingStep("role");- trackOnboardingStep("preparing");-- expect(sendDatafastEvent).toHaveBeenCalledTimes(2);- });-- it("still reports when sessionStorage is unavailable", () => {- vi.spyOn(Storage.prototype, "getItem").mockImplementation(() => {- throw new Error("storage blocked");- });-- trackOnboardingStep("role");-- expect(sendDatafastEvent).toHaveBeenCalledTimes(1);- });-- it("never throws when the DataFast script does", () => {- sendDatafastEvent.mockImplementation(() => {- throw new Error("datafast unavailable");- });-- expect(() => trackOnboardingStep("role")).not.toThrow();- });+ it.each([false, true])(+ "tracks the optional connection step once, with intro=%s",+ (hasIntro) => {+ const steps = buildStepLayout({ hasIntro, hasConnect: true });+ const key = onboardingStepKey(steps, steps.connect!);+ expect(key).toBe("connect");+ if (key) {+ trackOnboardingStep(key);+ trackOnboardingStep(key);+ }+ expect(posthog.capture.mock.calls).toEqual([+ ["onboarding_step_viewed", { step: "connect" }],+ ]);+ },+ );});--it.each([false, true])(- "tracks the optional connection step once, with intro=%s",- (hasIntro) => {- sessionStorage.clear();- sendDatafastEvent.mockReset();- const steps = buildStepLayout({ hasIntro, hasConnect: true });- const key = onboardingStepKey(steps, steps.connect!);- expect(key).toBe("connect");- if (key) {- trackOnboardingStep(key);- trackOnboardingStep(key);- }- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith(- "onboarding_connect",- {},- );- },-);diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/__tests__/HireStep.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/__tests__/HireStep.test.tsxindex ba4a0e38b8..2a32cca237 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/__tests__/HireStep.test.tsx+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/__tests__/HireStep.test.tsx@@ -5,11 +5,6 @@ import { server } from "@/mocks/mock-server";import { render, screen, waitFor } from "@/tests/integrations/test-utils";import userEvent from "@testing-library/user-event";import { http, HttpResponse } from "msw";-import {- configureCookiebot,- installCookiebot,- removeCookiebot,-} from "@/tests/integrations/cookiebot";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { useOnboardingWizardStore } from "../../../store";import { HireStep } from "../HireStep";@@ -197,33 +192,6 @@ describe("HireStep — hiring", () => {);});- it("sends the funnel start and the DataFast hire goal", async () => {- // The backend emits this hire's expert_hired, so without the start the- // funnel's completion rate is unreadable for onboarding hires.- configureCookiebot();- installCookiebot({ statistics: true });- const datafast = vi.fn();- (window as unknown as { datafast: typeof datafast }).datafast = datafast;- mockTeam(TEAM);- render(<HireStep />);-- await userEvent.click(- (await screen.findAllByRole("button", { name: "Hire" }))[0],- );-- await waitFor(() =>- expect(capture).toHaveBeenCalledWith("hire_started", {- template_id: "tpl-maria",- surface: "onboarding",- }),- );- await waitFor(() =>- expect(datafast).toHaveBeenCalledWith("hire_completed", {- template_id: "tpl-maria",- }),- );- });-it("shows templates hired on an earlier visit as hired", async () => {mockTeam(TEAM);useOnboardingWizardStore.getState().markHired("tpl-max");@@ -352,6 +320,5 @@ it("stops waiting after the deadline if transient errors persist", async () => {}, 26000);afterEach(() => {- removeCookiebot();vi.unstubAllEnvs();});diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/useHireStep.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/useHireStep.tsindex 9456f5a0c5..15c235af11 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/useHireStep.ts+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/HireStep/useHireStep.ts@@ -4,7 +4,6 @@ import type { ExpertRecommendations } from "@/app/api/__generated__/models/experimport type { RecommendedExpert } from "@/app/api/__generated__/models/recommendedExpert";import { toast } from "@/components/molecules/Toast/use-toast";import { invalidateExpertRosterQueries } from "@/services/experts/invalidate-experts";-import { analytics } from "@/services/analytics";import { trackFunnel } from "@/services/experts/experts-analytics";import { trackBrainDump } from "@/services/onboarding/brain-dump-analytics";import { useQueryClient } from "@tanstack/react-query";@@ -90,9 +89,6 @@ export function useHireStep() {await hireExpert({data: { template_id: expert.template_id, surface: "onboarding" },});- analytics.sendDatafastEvent("hire_completed", {- template_id: expert.template_id,- });markHired(expert.template_id);// Best effort: the roster is not on screen here, and a failed// invalidation must not read as a failed hire.diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/__tests__/tracking.test.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/__tests__/tracking.test.tsindex ac9282201f..d579ffa2ad 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/__tests__/tracking.test.ts+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/__tests__/tracking.test.ts@@ -1,13 +1,5 @@import { beforeEach, describe, expect, it, vi } from "vitest";-const { sendDatafastEvent } = vi.hoisted(() => ({- sendDatafastEvent: vi.fn(),-}));--vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));-const { posthog } = vi.hoisted(() => ({posthog: { __loaded: true, is_capturing: () => true, capture: vi.fn() },}));@@ -22,7 +14,6 @@ import {describe("PostHog paywall funnel", () => {beforeEach(() => {vi.restoreAllMocks();- sendDatafastEvent.mockReset();posthog.capture.mockReset();sessionStorage.clear();});@@ -67,49 +58,3 @@ describe("PostHog paywall funnel", () => {]);});});--describe("trackPaywallView", () => {- beforeEach(() => {- vi.restoreAllMocks();- sendDatafastEvent.mockReset();- sessionStorage.clear();- });-- it("reports the paywall impression", () => {- trackPaywallView();-- expect(sendDatafastEvent).toHaveBeenCalledTimes(1);- expect(sendDatafastEvent).toHaveBeenCalledWith("paywall_view", {});- });-- // Cancelling Stripe checkout returns to `?step=1&subscription=cancelled` as a- // full navigation, remounting the paywall. Without the session guard that- // second mount would inflate the funnel's denominator.- it("reports at most once per session", () => {- trackPaywallView();- trackPaywallView();-- expect(sendDatafastEvent).toHaveBeenCalledTimes(1);- });-- it("still reports when sessionStorage is unavailable", () => {- vi.spyOn(Storage.prototype, "getItem").mockImplementation(() => {- throw new Error("storage blocked");- });-- trackPaywallView();-- expect(sendDatafastEvent).toHaveBeenCalledTimes(1);- });-- // This runs in a mount effect on the screen users pay from: if a third-party- // script failure escaped, React would unmount the paywall into an error- // boundary and there would be nothing to buy.- it("never throws when the DataFast script does", () => {- sendDatafastEvent.mockImplementation(() => {- throw new Error("datafast unavailable");- });-- expect(() => trackPaywallView()).not.toThrow();- });-});diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/tracking.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/tracking.tsindex 9c6e91c695..4622ab30ee 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/tracking.ts+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/tracking.ts@@ -1,55 +1,28 @@-import { analytics } from "@/services/analytics";import {trackCheckoutAbandoned,trackPaywallViewed,} from "@/services/analytics/monetization-analytics";-const PAYWALL_VIEW_SESSION_KEY = "paywall_view_tracked";-/*** Reports that the user was actually shown the paywall.*- * Onboarding's steps all share the `/onboarding` URL (the `?step=` param is- * stripped by DataFast), so without this event the funnel can't tell "never- * reached the subscription screen" from "saw the price and declined" — which- * is the only question that matters between signup and payment.+ * Onboarding's steps all share the `/onboarding` URL, so without this event+ * the funnel can't tell "never reached the subscription screen" from "saw the+ * price and declined" — which is the only question that matters between+ * signup and payment.** Deliberately untagged by pricing arm. `posthog.init` runs in an effect with* no bootstrap, so the experiment variant is still unresolved when this step* mounts and would record "control" for everyone; PostHog records arm* assignment itself, so segmentation belongs there rather than here.*- * Fires at most once per tab. Two paths would otherwise double-count:- * cancelling Stripe checkout returns to `?step=1&subscription=cancelled` as a- * full navigation that remounts this step, and a render committed before the- * wizard's init effect corrects `currentStep` can briefly mount the paywall at- * the store default of step 1. A genuinely new view (new tab or session) finds- * the key unset and reports normally.+ * PostHog keeps its own once-per-tab guard, marked only once the event is sent+ * or dropped for lack of consent, not while it waits for the answer.*/export function trackPaywallView() {- // PostHog keeps its own once-per-tab guard, marked only once the event is- // sent or dropped for lack of consent, not while it waits for the answer.trackPaywallViewed("onboarding");-- try {- if (sessionStorage.getItem(PAYWALL_VIEW_SESSION_KEY)) return;- sessionStorage.setItem(PAYWALL_VIEW_SESSION_KEY, "1");- } catch {- // In-app browsers may block sessionStorage — double-counting a view beats- // dropping it, so fall through to report either way.- }-- try {- analytics.sendDatafastEvent("paywall_view", {});- } catch {- // sendDatafastEvent hands the event to the third-party DataFast script,- // which it calls without a guard of its own. This runs in a mount effect on- // the screen users pay from, so an exception here would unmount the paywall- // into an error boundary. Analytics must never be able to take checkout down.- }}-const CHECKOUT_CANCELLED_SESSION_KEY = "paywall_checkout_cancelled_tracked";const POSTHOG_CHECKOUT_CANCELLED_KEY ="posthog_checkout_abandoned_onboarding_subscription";@@ -71,7 +44,7 @@ export function markPaywallCheckoutStarted() {** Distinguishes "looked at the price and never clicked" from "picked a plan,* saw the card form, and backed out" — two very different problems that- * `paywall_view` alone cannot separate, since Stripe is off-domain.+ * `paywall_viewed` alone cannot separate, since Stripe is off-domain.** Guarded per tab because the `subscription=cancelled` param persists after the* return: the wizard's URL-sync effect only rewrites the query when the step@@ -83,17 +56,4 @@ export function trackPaywallCheckoutCancelled() {{ checkout_kind: "subscription", surface: "onboarding" },POSTHOG_CHECKOUT_CANCELLED_KEY,);-- try {- if (sessionStorage.getItem(CHECKOUT_CANCELLED_SESSION_KEY)) return;- sessionStorage.setItem(CHECKOUT_CANCELLED_SESSION_KEY, "1");- } catch {- // In-app browsers may block sessionStorage — double-counting beats dropping.- }-- try {- analytics.sendDatafastEvent("paywall_checkout_cancelled", {});- } catch {- // Never let analytics take the checkout UI down; see trackPaywallView.- }}diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.trial.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.trial.test.tsxindex 4f38e43e97..97f3ad50fb 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.trial.test.tsx+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.trial.test.tsx@@ -222,7 +222,6 @@ test.each([const start = await card.findByRole("button", {name: "Start 7-day trial",});- expect(start.getAttribute("data-fast-goal")).not.toBe("plan_cta_click");fireEvent.click(start);await waitFor(() =>expect(checkoutLocation.assign).toHaveBeenCalledWith(@@ -334,7 +333,7 @@ test("refreshes a rejected offer and submits its new token on retry", async () =});});-test("retains paid checkout, Google Ads value, and DataFast metadata while a trial is eligible", async () => {+test("retains paid checkout and Google Ads value while a trial is eligible", async () => {mockStatus();vi.stubEnv("NEXT_PUBLIC_GOOGLE_ADS_ID", "AW-123");vi.stubEnv("NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABELS", "begin_checkout=BC");@@ -351,10 +350,6 @@ test("retains paid checkout, Google Ads value, and DataFast metadata while a triconst pro = within(screen.getByRole("region", { name: "Pro plan" }),).getByRole("button", { name: /^Get Pro/ });- expect(pro.getAttribute("data-fast-goal")).toBe("plan_cta_click");- expect(pro.getAttribute("data-fast-goal-plan")).toBe("pro");- expect(pro.getAttribute("data-fast-goal-cycle")).toBe("monthly");- expect(pro.getAttribute("data-fast-goal-surface")).toBe("onboarding_paywall");fireEvent.click(pro);await waitFor(() =>expect(checkoutLocation.href).toBe("https://checkout.stripe.com/paid"),@@ -385,9 +380,6 @@ test("switches to the offered billing cycle without starting either checkout", aexpect(screen.queryByRole("button", { name: "Start 7-day trial" }),).toBeNull();- const toggle = screen.getByRole("button", { name: /Monthly billing/i });- expect(toggle.getAttribute("data-fast-goal")).toBe("paywall_billing_toggle");- expect(toggle.getAttribute("data-fast-goal-cycle")).toBe("monthly");fireEvent.click(alternative);expect(useOnboardingWizardStore.getState().selectedBilling).toBe("monthly");await screen.findByRole("button", { name: "Start 7-day trial" });diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/tracking.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/tracking.tsindex c26c8eb413..a0b6acf4ed 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/tracking.ts+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/tracking.ts@@ -1,4 +1,3 @@-import { analytics } from "@/services/analytics";import { capturePostHogEvent } from "@/services/analytics/posthog-capture";import { OnboardingEvent } from "@/services/analytics/posthog-events";import type { StepLayout } from "./store";@@ -12,7 +11,6 @@ export type OnboardingStepKey =| "hire"| "preparing";-const SENT_KEY_PREFIX = "onboarding_step_sent_";const POSTHOG_SENT_KEY_PREFIX = "posthog_onboarding_step_viewed_";/**@@ -21,7 +19,7 @@ const POSTHOG_SENT_KEY_PREFIX = "posthog_onboarding_step_viewed_";* Step numbers differ between layouts, so the number alone is meaningless* across cohorts — Preparing is 4 without a paywall and 5 with one. Keying by* name keeps a single funnel readable for all. The subscription step returns- * null: it is reported as `paywall_view` instead.+ * null: it is reported as `paywall_viewed` instead.*/export function onboardingStepKey(steps: StepLayout,@@ -43,37 +41,16 @@ export function onboardingStepKey(* The wizard's steps share the `/onboarding` URL and the backend records* only ONBOARDING_COMPLETE, so without this nothing distinguishes "abandoned on* Role" from "abandoned on Preparing" — the drop between signup and copilot is- * a single opaque number.+ * a single opaque number. PostHog funnels order steps by their filter, so one+ * event with a `step` property serves every step.*- * One goal per step rather than one goal carrying the step as metadata, because- * DataFast funnel steps match on goal name; metadata could not express an- * ordered funnel.+ * The once-per-tab guard is marked only once the event is sent or dropped for+ * lack of consent, not while it waits for the answer.*/export function trackOnboardingStep(key: OnboardingStepKey) {- // PostHog funnels order steps by their filter, so one event with a `step`- // property serves where DataFast needs a goal per step. Its once-per-tab- // guard is its own, marked only once the event is sent or dropped for lack- // of consent, not while it waits for the answer.capturePostHogEvent(OnboardingEvent.ONBOARDING_STEP_VIEWED,{ step: key },{ oncePerTabKey: `${POSTHOG_SENT_KEY_PREFIX}${key}` },);-- const sentKey = `${SENT_KEY_PREFIX}${key}`;- try {- if (sessionStorage.getItem(sentKey)) return;- sessionStorage.setItem(sentKey, "1");- } catch {- // In-app browsers may block sessionStorage — double-counting a step beats- // dropping it, so fall through to report either way.- }-- try {- analytics.sendDatafastEvent(`onboarding_${key}`, {});- } catch {- // sendDatafastEvent hands off to the third-party DataFast script, which it- // calls without a guard of its own. This runs inside the onboarding wizard,- // so an exception here would unmount the flow into an error boundary.- }}diff --git a/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsx b/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsxindex 090f10b09e..05d4ac7622 100644--- a/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsx@@ -115,7 +115,6 @@ export function PaywallModal() {// The modal renders its own title above, so the organism// contributes only the billing toggle.header={null}- goalSurface="upgrade_modal"plans={plans}country={country}billing={selectedCycle}diff --git a/autogpt_platform/frontend/src/app/(platform)/PaywallGate/__tests__/PaywallModal.trial.test.tsx b/autogpt_platform/frontend/src/app/(platform)/PaywallGate/__tests__/PaywallModal.trial.test.tsxindex 15e505995a..d27e8f5d39 100644--- a/autogpt_platform/frontend/src/app/(platform)/PaywallGate/__tests__/PaywallModal.trial.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PaywallGate/__tests__/PaywallModal.trial.test.tsx@@ -186,18 +186,13 @@ test("reports the offer impression against the billing surface", async () => {);});-test("labels paid signup Start Max and keeps checkout reporting against the upgrade_modal surface", async () => {+test("labels paid signup Start Max", async () => {server.use(getGetTrialsGetTrialStatusMockHandler200(eligible()));render(<PaywallModal />);const max = within(await screen.findByRole("region", { name: "Max plan" }));- const paid = max.getByRole("button", { name: "Start Max" });- expect(paid.getAttribute("data-fast-goal")).toBe("plan_cta_click");- expect(paid.getAttribute("data-fast-goal-surface")).toBe("upgrade_modal");-- const toggle = screen.getByRole("button", { name: /yearly/i });- expect(toggle.getAttribute("data-fast-goal-surface")).toBe("upgrade_modal");+ expect(max.getByRole("button", { name: "Start Max" })).toBeDefined();});test("leaves the paid CTAs alone when the user is not eligible", async () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/preview/[id]/page.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/preview/[id]/page.tsxindex e781e792f7..1e5233f89b 100644--- a/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/preview/[id]/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/admin/marketplace/preview/[id]/page.tsx@@ -112,7 +112,6 @@ export default function AdminPreviewPage() {<div className="lg:col-span-2"><AgentInfouser={null}- agentId={data.graph_id}name={data.agent_name}creator={data.creator}creatorAvatar={data.creator_avatar}diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/CronSchedulerDialog/useCronSchedulerDialog.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/CronSchedulerDialog/useCronSchedulerDialog.tsindex 1c7fbfb2f9..2c60126fce 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/CronSchedulerDialog/useCronSchedulerDialog.ts+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/CronSchedulerDialog/useCronSchedulerDialog.ts@@ -1,7 +1,6 @@import type { ScheduleCreationRequest } from "@/app/api/__generated__/models/scheduleCreationRequest";import { usePostV1CreateExecutionSchedule } from "@/app/api/__generated__/endpoints/schedules/schedules";import { useToast } from "@/components/molecules/Toast/use-toast";-import { trackScheduleCreatedGoal } from "@/services/analytics/activation-goals";import { useUserTimezone } from "@/lib/hooks/useUserTimezone";import { getTimezoneDisplayName } from "@/lib/timezone-utils";import { invalidateAllScheduleQueries } from "@/services/schedules/invalidate-schedules";@@ -47,7 +46,6 @@ export function useCronSchedulerDialog({title: "Schedule created",description: "Schedule created successfully",});- if (flowID) trackScheduleCreatedGoal(flowID, "builder");invalidateAllScheduleQueries(queryClient, flowID ?? undefined);}},diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.test.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.test.tsxindex 696b6d32a7..e444370c9e 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.test.tsx@@ -28,11 +28,6 @@ vi.mock("@/app/(platform)/build/hooks/useSaveGraph", () => ({const mockExecuteGraph = vi.fn();const mockStopGraph = vi.fn();-const mockSendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent: mockSendDatafastEvent },-}));-interface ExecutionVariables {data: { dry_run?: boolean };}@@ -157,21 +152,7 @@ describe("useRunGraph", () => {expect(graphState.setIsGraphRunning).not.toHaveBeenCalled();});- it("records a successful real run with its builder surface", async () => {- mockSaveGraph.mockResolvedValue({ id: "graph-1", version: 1 });- const { result } = renderHook(() => useRunGraph());-- await act(async () => {- await result.current.handleRunGraph();- });-- expect(mockSendDatafastEvent).toHaveBeenCalledExactlyOnceWith("run_agent", {- id: "graph-1",- surface: "builder",- });- });-- it("does not count a simulation as an activation", async () => {+ it("sends a simulation as a dry run", async () => {mockSaveGraph.mockResolvedValue({ id: "graph-1", version: 1 });const { result } = renderHook(() => useRunGraph());@@ -184,6 +165,5 @@ describe("useRunGraph", () => {data: expect.objectContaining({ dry_run: true }),}),);- expect(mockSendDatafastEvent).not.toHaveBeenCalled();});});diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.tsindex 5eced161bc..d5999115ae 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.ts+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunGraph/useRunGraph.ts@@ -5,7 +5,6 @@ import {import { useToast } from "@/components/molecules/Toast/use-toast";import { parseAsInteger, parseAsString, useQueryStates } from "nuqs";import { GraphExecutionMeta } from "@/app/api/__generated__/models/graphExecutionMeta";-import { trackAgentRunGoal } from "@/services/analytics/activation-goals";import { useGraphStore } from "@/app/(platform)/build/stores/graphStore";import { useShallow } from "zustand/react/shallow";import { useEffect, useState } from "react";@@ -78,17 +77,12 @@ export const useRunGraph = () => {const { mutateAsync: executeGraph, isPending: isExecutingGraph } =usePostV1ExecuteGraphAgent({mutation: {- onSuccess: (response, variables) => {+ onSuccess: (response) => {clearAllNodeErrors();- const { id, graph_id } = response.data as GraphExecutionMeta;+ const { id } = response.data as GraphExecutionMeta;setQueryStates({flowExecutionID: id,});- // Simulate goes through the same mutation as Run; only a real run- // is an activation.- if (!variables.data.dry_run) {- trackAgentRunGoal(graph_id, "builder");- }},onError: (error: any) => {setIsGraphRunning(false);diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.test.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.test.tsxindex 90ceaadf24..97b90843b9 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.test.tsx@@ -20,10 +20,6 @@ vi.mock("@/components/molecules/Toast/use-toast", () => ({}));const mockExecuteGraph = vi.fn();-const mockSendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent: mockSendDatafastEvent },-}));interface ExecutionOptions {mutation: {@@ -130,19 +126,4 @@ describe("useRunInputDialog", () => {expect.objectContaining({ graphId: "graph-1", graphVersion: 1 }),);});-- it("records a successful run from the input dialog", async () => {- const { result } = renderHook(() =>- useRunInputDialog({ setIsOpen: vi.fn() }),- );-- await act(async () => {- await result.current.handleManualRun();- });-- expect(mockSendDatafastEvent).toHaveBeenCalledExactlyOnceWith("run_agent", {- id: "graph-1",- surface: "builder",- });- });});diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.ts b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.tsindex 32e3da84a3..2a1b49dca1 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.ts+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderActions/components/RunInputDialog/useRunInputDialog.ts@@ -1,6 +1,5 @@import { useGraphStore } from "@/app/(platform)/build/stores/graphStore";import { usePostV1ExecuteGraphAgent } from "@/app/api/__generated__/endpoints/graphs/graphs";-import { trackAgentRunGoal } from "@/services/analytics/activation-goals";import {ApiError,@@ -45,11 +44,10 @@ export const useRunInputDialog = ({usePostV1ExecuteGraphAgent({mutation: {onSuccess: (response) => {- const { id, graph_id } = response.data as GraphExecutionMeta;+ const { id } = response.data as GraphExecutionMeta;setQueryStates({flowExecutionID: id,});- trackAgentRunGoal(graph_id, "builder");},onError: (error) => {if (error instanceof ApiError && error.isGraphValidationError()) {diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ConnectionPicker/MaxUpgradeCard.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ConnectionPicker/MaxUpgradeCard.tsxindex 5640c7c92e..88100444f5 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ConnectionPicker/MaxUpgradeCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ConnectionPicker/MaxUpgradeCard.tsx@@ -54,8 +54,6 @@ export function MaxUpgradeCard({ label, name, model, reason, href }: Props) {variant="primary"size="small"className="mt-5 h-11 w-full rounded-lg border-purple-600 bg-purple-600 text-white hover:border-purple-700 hover:bg-purple-700"- data-fast-goal="subscription_upgrade_intent"- data-fast-goal-surface="model_picker">Upgrade to Max<Icon icon={ArrowRight02Icon} size={16} aria-hidden />diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.test.tsxindex 8ac5eec440..690cb93b3f 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.test.tsx@@ -15,11 +15,6 @@ function wrapper({ children }: { children: ReactNode }) {return <QueryClientProvider client={client}>{children}</QueryClientProvider>;}-const sendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));-const toastMock = vi.fn();vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => {const actual =@@ -49,12 +44,11 @@ const execution = {afterEach(() => {toastMock.mockClear();- sendDatafastEvent.mockClear();server.resetHandlers();});describe("useAgentRunModal", () => {- test("a real run records the run_agent goal from the library surface", async () => {+ test("a run hands the new run to onRun", async () => {server.use(getPostV1ExecuteGraphAgentMockHandler(execution));const onRun = vi.fn();@@ -71,13 +65,9 @@ describe("useAgentRunModal", () => {expect.objectContaining({ id: "run-1" }),);});- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith("run_agent", {- id: "graph-xyz",- surface: "library",- });});- test("a simulation goes through the same mutation but is not an activation", async () => {+ test("a simulation hands the new run to onRun too", async () => {server.use(getPostV1ExecuteGraphAgentMockHandler(execution));const onRun = vi.fn();@@ -94,6 +84,5 @@ describe("useAgentRunModal", () => {expect.objectContaining({ id: "run-1" }),);});- expect(sendDatafastEvent).not.toHaveBeenCalled();});});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.tsxindex 33f914d2ec..9596c974dd 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/RunAgentModal/useAgentRunModal.tsx@@ -12,7 +12,6 @@ import { LibraryAgentPreset } from "@/app/api/__generated__/models/libraryAgentPimport { useToast } from "@/components/molecules/Toast/use-toast";import { isEmpty } from "@/lib/utils";import { CredentialsProvidersContext } from "@/providers/agent-credentials/credentials-provider";-import { trackAgentRunGoal } from "@/services/analytics/activation-goals";import { useQueryClient } from "@tanstack/react-query";import {useCallback,@@ -157,7 +156,7 @@ export function useAgentRunModal(// API mutationsconst executeGraphMutation = usePostV1ExecuteGraphAgent({mutation: {- onSuccess: (response, variables) => {+ onSuccess: (response) => {if (response.status === 200) {toast({title: "Workflow execution started",@@ -166,11 +165,6 @@ export function useAgentRunModal(queryKey: getGetV1ListGraphExecutionsQueryKey(agent.graph_id),});callbacks?.onRun?.(response.data);- // Simulate goes through the same mutation as Run; only a real run- // is an activation.- if (!variables.data.dry_run) {- trackAgentRunGoal(agent.graph_id, "library");- }setIsOpen(false);}},diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/useScheduleAgentModal.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/useScheduleAgentModal.tsindex 1005be147c..85f02baa58 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/useScheduleAgentModal.ts+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/modals/ScheduleAgentModal/useScheduleAgentModal.ts@@ -2,7 +2,6 @@ import { usePostV1CreateExecutionSchedule as useCreateSchedule } from "@/app/apiimport { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { useToast } from "@/components/molecules/Toast/use-toast";-import { trackScheduleCreatedGoal } from "@/services/analytics/activation-goals";import { invalidateAllScheduleQueries } from "@/services/schedules/invalidate-schedules";import { useQueryClient } from "@tanstack/react-query";import { useCallback, useMemo, useState } from "react";@@ -34,7 +33,6 @@ export function useScheduleAgentModal(toast({title: "Schedule created",});- trackScheduleCreatedGoal(agent.graph_id, "library");callbacks?.onCreateSchedule?.(response.data);invalidateAllScheduleQueries(queryClient, agent.graph_id);// Reset formdiff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.test.tsxindex ab54397522..3365256c65 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.test.tsx@@ -16,11 +16,6 @@ function wrapper({ children }: { children: ReactNode }) {return <QueryClientProvider client={client}>{children}</QueryClientProvider>;}-const sendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));-const toastMock = vi.fn();vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => {const actual =@@ -51,12 +46,11 @@ const run = {afterEach(() => {toastMock.mockClear();- sendDatafastEvent.mockClear();server.resetHandlers();});describe("useSelectedRunActions", () => {- test("handleRunAgain records a run_agent goal from the rerun surface", async () => {+ test("handleRunAgain selects the new run", async () => {server.use(getPostV1ExecuteGraphAgentMockHandler({id: "run-1",@@ -83,13 +77,9 @@ describe("useSelectedRunActions", () => {await waitFor(() => {expect(onSelectRun).toHaveBeenCalledWith("run-1");});- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith("run_agent", {- id: "graph-xyz",- surface: "rerun",- });});- test("handleRunAgain without a run surfaces a destructive toast and no goal", async () => {+ test("handleRunAgain without a run surfaces a destructive toast", async () => {const { result } = renderHook(() => useSelectedRunActions({ agentGraphId: "graph-xyz", agent }),{ wrapper },@@ -105,6 +95,5 @@ describe("useSelectedRunActions", () => {variant: "destructive",}),);- expect(sendDatafastEvent).not.toHaveBeenCalled();});});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.tsindex b4088238e1..9bcfd9d964 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.ts+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedRunView/components/SelectedRunActions/useSelectedRunActions.ts@@ -12,7 +12,6 @@ import {import type { GraphExecution } from "@/app/api/__generated__/models/graphExecution";import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { okData } from "@/app/api/helpers";-import { trackAgentRunGoal } from "@/services/analytics/activation-goals";import { useToast } from "@/components/molecules/Toast/use-toast";import { useQueryClient } from "@tanstack/react-query";import { useState } from "react";@@ -98,9 +97,6 @@ export function useSelectedRunActions({});const newRunId = okData(res)?.id;- if (newRunId) {- trackAgentRunGoal(run.graph_id, "rerun");- }await queryClient.invalidateQueries({queryKey: getGetV1ListGraphExecutionsQueryKey(agentGraphId),diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.test.tsxindex 115abd337e..e48b5c52d8 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.test.tsx@@ -18,11 +18,6 @@ function wrapper({ children }: { children: ReactNode }) {return <QueryClientProvider client={client}>{children}</QueryClientProvider>;}-const sendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));-const toastMock = vi.fn();vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => {const actual =@@ -52,7 +47,6 @@ const schedule = {afterEach(() => {toastMock.mockClear();- sendDatafastEvent.mockClear();server.resetHandlers();});@@ -123,7 +117,7 @@ describe("useSelectedScheduleActions", () => {);});- test("handleRunNow records a run_agent goal from the library surface", async () => {+ test("handleRunNow selects the new run", async () => {server.use(getPostV1ExecuteGraphAgentMockHandler({id: "run-1",@@ -150,9 +144,5 @@ describe("useSelectedScheduleActions", () => {await waitFor(() => {expect(onSelectRun).toHaveBeenCalledWith("run-1");});- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith("run_agent", {- id: "graph-xyz",- surface: "library",- });});});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.ts b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.tsindex be91e17781..ce4efa4a5b 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.ts+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/SelectedScheduleView/components/SelectedScheduleActions/useSelectedScheduleActions.ts@@ -8,7 +8,6 @@ import { useDeleteV1DeleteExecutionSchedule } from "@/app/api/__generated__/endpimport type { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { okData } from "@/app/api/helpers";-import { trackAgentRunGoal } from "@/services/analytics/activation-goals";import { useToast } from "@/components/molecules/Toast/use-toast";import { invalidateAllScheduleQueries } from "@/services/schedules/invalidate-schedules";import { useQueryClient } from "@tanstack/react-query";@@ -87,9 +86,6 @@ export function useSelectedScheduleActions({});const newRunID = okData(res)?.id;- if (newRunID) {- trackAgentRunGoal(schedule.graph_id, "library");- }await queryClient.invalidateQueries({queryKey: getGetV1ListGraphExecutionsQueryKey(agent.graph_id),diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.test.tsxindex 81456db54d..7fa3d1c616 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.test.tsx@@ -12,11 +12,6 @@ import {import { afterEach, describe, expect, test, vi } from "vitest";import { ScheduleActionsDropdown } from "./ScheduleActionsDropdown";-const sendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));-const toastMock = vi.fn();vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => {const actual =@@ -46,12 +41,11 @@ const schedule = {afterEach(() => {toastMock.mockClear();- sendDatafastEvent.mockClear();server.resetHandlers();});describe("ScheduleActionsDropdown", () => {- test("Run now records a run_agent goal from the library surface", async () => {+ test("Run now hands the new run on", async () => {server.use(getPostV1ExecuteGraphAgentMockHandler({id: "run-1",@@ -77,9 +71,5 @@ describe("ScheduleActionsDropdown", () => {await waitFor(() => {expect(onRunCreated).toHaveBeenCalledWith("run-1");});- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith("run_agent", {- id: "graph-xyz",- surface: "library",- });});});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.tsxindex ef565d1442..14915fa782 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/sidebar/SidebarRunsList/components/ScheduleActionsDropdown.tsx@@ -8,7 +8,6 @@ import { useDeleteV1DeleteExecutionSchedule } from "@/app/api/__generated__/endpimport type { GraphExecutionJobInfo } from "@/app/api/__generated__/models/graphExecutionJobInfo";import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { okData } from "@/app/api/helpers";-import { trackAgentRunGoal } from "@/services/analytics/activation-goals";import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";import { Dialog } from "@/components/molecules/Dialog/Dialog";@@ -88,9 +87,6 @@ export function ScheduleActionsDropdown({});const newRunID = okData(res)?.id;- if (newRunID) {- trackAgentRunGoal(schedule.graph_id, "library");- }await queryClient.invalidateQueries({queryKey: getGetV1ListGraphExecutionsQueryKey(agent.graph_id),diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsxindex e7213d3ffb..1bc19cc6bd 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/__tests__/install-on-expert.test.tsx@@ -13,11 +13,6 @@ import { Toaster } from "@/components/molecules/Toast/toaster";import { server } from "@/mocks/mock-server";import { render, screen, waitFor } from "@/tests/integrations/test-utils";import userEvent from "@testing-library/user-event";-import {- configureCookiebot,- installCookiebot,- removeCookiebot,-} from "@/tests/integrations/cookiebot";import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";import { MainAgentPage } from "../components/MainAgentPage/MainAgentPage";@@ -95,14 +90,8 @@ function renderAgentPage() {);}-const datafast = vi.fn();-describe("Install on Expert from marketplace detail", () => {beforeEach(() => {- configureCookiebot();- installCookiebot({ statistics: true });- datafast.mockReset();- (window as unknown as { datafast: typeof datafast }).datafast = datafast;mockUseAuth.mockReturnValue({user: { id: "user-1" },isLoggedIn: true,@@ -110,7 +99,6 @@ describe("Install on Expert from marketplace detail", () => {});afterEach(() => {- removeCookiebot();vi.unstubAllEnvs();});@@ -147,9 +135,6 @@ describe("Install on Expert from marketplace detail", () => {expect(await screen.findByText("Installed on Maria")).toBeDefined();expect(installExpertId).toBe("expert-maria");expect(installBody).toEqual({ store_listing_version_id: "listing-1" });- expect(datafast).toHaveBeenCalledWith("workflow_installed_on_expert", {- expert_id: "expert-maria",- });});test("toasts success when the workflow is already installed", async () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsxindex ab05705761..36b2509d14 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AddToLibraryButton/AddToLibraryButton.tsx@@ -12,7 +12,6 @@ import { LibraryAgentResponse } from "@/app/api/__generated__/models/libraryAgenimport { Button } from "@/components/atoms/Button/Button";import { useToast } from "@/components/molecules/Toast/use-toast";import { useAuth } from "@/lib/auth/hooks/useAuth";-import { analytics } from "@/services/analytics";import * as Sentry from "@sentry/nextjs";import { useQueryClient } from "@tanstack/react-query";import { useState } from "react";@@ -135,8 +134,6 @@ export function AddToLibraryButton({queryKey: getGetV2ListLibraryAgentsQueryKey(),});- analytics.sendDatafastEvent("add_to_library", { id: data.id });-const addedToast = toast({title: `Workflow ${agentName} added to your library.`,description: (diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/AgentInfo.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/AgentInfo.tsxindex 830279e720..7ff3bd13e5 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/AgentInfo.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/AgentInfo.tsx@@ -23,7 +23,6 @@ import { Icon } from "@/components/atoms/Icon/Icon";interface AgentInfoProps {user: User | null;- agentId: string;name: string;creator: string;creatorAvatar?: string;@@ -41,7 +40,6 @@ interface AgentInfoProps {export const AgentInfo = ({user,- agentId,name,creator,creatorAvatar,@@ -228,7 +226,7 @@ export const AgentInfo = ({variant="ghost"size="small"loading={isDownloadingAgent}- onClick={() => handleDownload(agentId, name)}+ onClick={() => handleDownload(name)}data-testid="agent-download-button"className="underline">diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.test.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.test.tsxdeleted file mode 100644index 48d331b568..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.test.tsx+++ /dev/null@@ -1,72 +0,0 @@-import { getPostV2AddMarketplaceAgentMockHandler } from "@/app/api/__generated__/endpoints/library/library.msw";-import { getGetV2DownloadAgentFileMockHandler } from "@/app/api/__generated__/endpoints/store/store.msw";-import type { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";-import { server } from "@/mocks/mock-server";-import { act, renderHook } from "@/tests/integrations/test-utils";-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";-import type { ReactNode } from "react";-import { afterEach, describe, expect, test, vi } from "vitest";-import { useAgentInfo } from "./useAgentInfo";--function wrapper({ children }: { children: ReactNode }) {- const client = new QueryClient({- defaultOptions: { queries: { retry: false } },- });- return <QueryClientProvider client={client}>{children}</QueryClientProvider>;-}--const sendDatafastEvent = vi.hoisted(() => vi.fn());-vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));--vi.mock("@/lib/utils", async (importOriginal) => ({- ...(await importOriginal<typeof import("@/lib/utils")>()),- exportAsJSONFile: vi.fn(),-}));--afterEach(() => {- sendDatafastEvent.mockClear();- server.resetHandlers();-});--describe("useAgentInfo", () => {- test("add_to_library carries the library ID and no workflow name", async () => {- server.use(- getPostV2AddMarketplaceAgentMockHandler({- id: "lib-1",- name: "Jane's private workflow",- } as LibraryAgent),- );- const { result } = renderHook(- () => useAgentInfo({ storeListingVersionId: "slv-1" }),- { wrapper },- );-- await act(() =>- result.current.handleLibraryAction({ isAddingAgentFirstTime: true }),- );-- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith(- "add_to_library",- { id: "lib-1" },- );- });-- test("download_agent carries the ID and no workflow name", async () => {- server.use(getGetV2DownloadAgentFileMockHandler());- const { result } = renderHook(- () => useAgentInfo({ storeListingVersionId: "slv-1" }),- { wrapper },- );-- await act(() =>- result.current.handleDownload("agent-1", "Jane's private workflow"),- );-- expect(sendDatafastEvent).toHaveBeenCalledExactlyOnceWith(- "download_agent",- { id: "agent-1" },- );- });-});diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.tsindex 889432e53c..5ebf56816c 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/AgentInfo/useAgentInfo.ts@@ -6,7 +6,6 @@ import { useToast } from "@/components/molecules/Toast/use-toast";import { useRouter } from "next/navigation";import * as Sentry from "@sentry/nextjs";import { useGetV2DownloadAgentFile } from "@/app/api/__generated__/endpoints/store/store";-import { analytics } from "@/services/analytics";import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { agentGraphExportFilename, exportAsJSONFile } from "@/lib/utils";import { useQueryClient } from "@tanstack/react-query";@@ -51,8 +50,6 @@ export const useAgentInfo = ({ storeListingVersionId }: UseAgentInfoProps) => {await queryClient.invalidateQueries({queryKey: getGetV2ListLibraryAgentsQueryKey(),});-- analytics.sendDatafastEvent("add_to_library", { id: data.id });}router.push(`/library/agents/${data.id}`);@@ -73,7 +70,7 @@ export const useAgentInfo = ({ storeListingVersionId }: UseAgentInfoProps) => {}};- const handleDownload = async (agentId: string, agentName: string) => {+ const handleDownload = async (agentName: string) => {try {const { data: file } = await downloadAgent();@@ -82,8 +79,6 @@ export const useAgentInfo = ({ storeListingVersionId }: UseAgentInfoProps) => {agentGraphExportFilename(file, agentName),);- analytics.sendDatafastEvent("download_agent", { id: agentId });-toast({title: "Download Complete",description: "Your workflow has been successfully downloaded.",diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainAgentPage/MainAgentPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainAgentPage/MainAgentPage.tsxindex f13ba47662..b34c847794 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainAgentPage/MainAgentPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainAgentPage/MainAgentPage.tsx@@ -100,7 +100,6 @@ export function MainAgentPage({ params }: Props) {<div className="w-full lg:w-2/5"><AgentInfouser={user}- agentId={agentData.active_version_id ?? "–"}name={agentData.agent_name ?? ""}creator={agentData.creator ?? ""}creatorAvatar={agentData.creator_avatar ?? ""}diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsxindex d73d8e2939..099b0053b2 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/AutomationCreditsTab/BalanceCard/BalanceCard.tsx@@ -113,8 +113,6 @@ export function BalanceCard({ index = 0 }: Props) {disabled={!isValid || isAdding || isRedirecting}loading={isAdding}onClick={handleSubmit}- data-fast-goal="credit_topup_checkout"- data-fast-goal-surface="settings_billing">Continue to checkout</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsxindex 8d54ecb98d..309612a83b 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/PaymentMethodCard/PaymentMethodCard.tsx@@ -47,8 +47,6 @@ export function PaymentMethodCard({ index = 0 }: Props) {variant="secondary"size="small"onClick={onManage}- data-fast-goal="billing_portal_open"- data-fast-goal-surface="settings_payment_method"disabled={!canManage}loading={isOpening}>diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsxindex f7f8dcd0b2..465209d6c7 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchCycleDialog.tsx@@ -69,8 +69,6 @@ export function SwitchCycleDialog({variant="primary"size="small"onClick={onConfirm}- data-fast-goal="subscription_cycle_confirm"- data-fast-goal-surface="settings_billing"disabled={isSaving}loading={isSaving}>diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsxindex 46f239a4fd..149e8a42c4 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog.tsx@@ -178,8 +178,6 @@ function ConfirmButton({onClick={onConfirm}disabled={disabled}loading={isSaving}- data-fast-goal="subscription_change_confirm"- data-fast-goal-surface="settings_billing">{label}</Button>diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsxindex fef5da7796..070feb14e8 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/components/SubscriptionTab/YourPlanCard/YourPlanCard.tsx@@ -194,8 +194,6 @@ export function YourPlanCard({ index = 0, showUsage = false }: Props) {size="small"onClick={onManage}disabled={!canManagePortal}- data-fast-goal="billing_portal_open"- data-fast-goal-surface="settings_billing">Manage subscription</Button>@@ -209,10 +207,6 @@ export function YourPlanCard({ index = 0, showUsage = false }: Props) {onClick={onUpgrade}disabled={isUpdatingTier || isRedirecting}loading={isUpdatingTier && !plan.nextTierIsTeamLink}- data-fast-goal="subscription_upgrade_click"- data-fast-goal-from={plan.label}- data-fast-goal-to={plan.nextTierLabel}- data-fast-goal-surface="settings_billing"rightIcon={plan.nextTierIsTeamLink ? (<Icon icon={LinkSquare01Icon} size={14} aria-hidden="true" />diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.test.tsxindex 67e9fddcc7..c50b317f14 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.test.tsx@@ -13,11 +13,6 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { act, renderHook, waitFor } from "@testing-library/react";import { http, HttpResponse } from "msw";import type { ReactNode } from "react";-import {- configureCookiebot,- installCookiebot,- removeCookiebot,-} from "@/tests/integrations/cookiebot";import { afterEach, describe, expect, it, vi } from "vitest";import { useFireExpertDialog } from "./useFireExpertDialog";@@ -64,10 +59,6 @@ describe("useFireExpertDialog invalidation", () => {const client = makeClient();const invalidateSpy = vi.spyOn(client, "invalidateQueries");const onFired = vi.fn();- configureCookiebot();- installCookiebot({ statistics: true });- const datafast = vi.fn();- (window as unknown as { datafast: typeof datafast }).datafast = datafast;const { result } = renderHook(() =>@@ -96,9 +87,6 @@ describe("useFireExpertDialog invalidation", () => {containsKey(calls, getGetV1ListExecutionSchedulesForAUserQueryKey()),).toBe(true);expect(containsKey(calls, ["/api/library/agents"])).toBe(true);- expect(datafast).toHaveBeenCalledWith("expert_fired", {- expert_id: "expert-maria",- });});it("does not fire before the preview has resolved", async () => {@@ -187,6 +175,5 @@ describe("useFireExpertDialog invalidation", () => {});afterEach(() => {- removeCookiebot();vi.unstubAllEnvs();});diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.ts b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.tsindex 3373535094..4c1f99ed70 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/FireExpertDialog/useFireExpertDialog.ts@@ -9,7 +9,6 @@ import { toast } from "@/components/molecules/Toast/use-toast";import { invalidateExpertRosterQueries } from "@/services/experts/invalidate-experts";import { invalidateAllScheduleQueries } from "@/services/schedules/invalidate-schedules";import { useQueryClient } from "@tanstack/react-query";-import { analytics } from "@/services/analytics";interface Args {expertId: string;@@ -35,7 +34,6 @@ export function useFireExpertDialog({const { mutate, isPending: isFiring } = useArchiveExpert({mutation: {onSuccess: async () => {- analytics.sendDatafastEvent("expert_fired", { expert_id: expertId });await Promise.all([invalidateExpertRosterQueries(queryClient),queryClient.invalidateQueries({diff --git a/autogpt_platform/frontend/src/components/molecules/InstallWorkflowPicker/useInstallWorkflowPicker.ts b/autogpt_platform/frontend/src/components/molecules/InstallWorkflowPicker/useInstallWorkflowPicker.tsindex 02f33db617..b92ab0e9aa 100644--- a/autogpt_platform/frontend/src/components/molecules/InstallWorkflowPicker/useInstallWorkflowPicker.ts+++ b/autogpt_platform/frontend/src/components/molecules/InstallWorkflowPicker/useInstallWorkflowPicker.ts@@ -17,7 +17,6 @@ import { LibraryAgent } from "@/app/api/__generated__/models/libraryAgent";import { StoreAgent } from "@/app/api/__generated__/models/storeAgent";import { StoreAgentsResponse } from "@/app/api/__generated__/models/storeAgentsResponse";import { toast } from "@/components/molecules/Toast/use-toast";-import { analytics } from "@/services/analytics";import { useDebouncedValue } from "@/hooks/useDebouncedValue";import { useQueryClient } from "@tanstack/react-query";import { useEffect, useState } from "react";@@ -180,9 +179,6 @@ export function useInstallWorkflowPicker({}try {await installWorkflow({ expertId: expert.id, data });- analytics.sendDatafastEvent("workflow_installed_on_expert", {- expert_id: expert.id,- });// Both: the picker is opened from the team list and from one expert's// own page, whose workflow section reads the single-expert query.await Promise.all([diff --git a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/SubscriptionPlans.tsx b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/SubscriptionPlans.tsxindex 9c3c823f03..abb553ba14 100644--- a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/SubscriptionPlans.tsx+++ b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/SubscriptionPlans.tsx@@ -5,20 +5,18 @@ import { PlanDetailsDialog } from "./components/PlanDetailsDialog/PlanDetailsDiaimport { PlanFooter } from "./components/PlanFooter";import { PlanHeader } from "./components/PlanHeader";import { SubscriptionOffer } from "./components/SubscriptionOffer";-import { DEFAULT_GOAL_SURFACE, type SubscriptionPlansProps } from "./helpers";+import type { SubscriptionPlansProps } from "./helpers";import { useSubscriptionPlans } from "./useSubscriptionPlans";export function SubscriptionPlans({trialStatus,header,- goalSurface = DEFAULT_GOAL_SURFACE,- ...rest+ ...props}: SubscriptionPlansProps & {trialStatus?: ReactNode;header?: ReactNode;}) {const { dialog, setDialog, setDialogOpen } = useSubscriptionPlans();- const props = { ...rest, goalSurface };return (<div className="mx-auto w-full max-w-7xl px-5 font-sans sm:px-8"><section aria-label="Choose your AutoGPT plan">diff --git a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/BillingToggle.tsx b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/BillingToggle.tsxindex b8354345b0..ab8a62b0b9 100644--- a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/BillingToggle.tsx+++ b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/BillingToggle.tsx@@ -2,16 +2,9 @@ import { Button } from "@/components/atoms/Button/Button";import { cn } from "@/lib/utils";import type { SubscriptionPlansProps } from "../helpers";-type Props = Pick<- SubscriptionPlansProps,- "billing" | "onBillingChange" | "goalSurface"->;+type Props = Pick<SubscriptionPlansProps, "billing" | "onBillingChange">;-export function BillingToggle({- billing,- onBillingChange,- goalSurface,-}: Props) {+export function BillingToggle({ billing, onBillingChange }: Props) {return (<divrole="group"@@ -26,9 +19,6 @@ export function BillingToggle({size="xs"aria-pressed={billing === cycle}onClick={() => onBillingChange(cycle)}- data-fast-goal="paywall_billing_toggle"- data-fast-goal-cycle={cycle}- data-fast-goal-surface={goalSurface}className={cn("rounded-full px-4 text-xs",billing === cyclediff --git a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/OfferActions.tsx b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/OfferActions.tsxindex 370514be5e..193d807b3c 100644--- a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/OfferActions.tsx+++ b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/OfferActions.tsx@@ -56,12 +56,10 @@ export function OfferActions(props: Props) {function PaidPlanAction({plan,- billing,isUpdatingTier,isStartingTrial,selectedPlan,onSelectPlan,- goalSurface,inline = false,price,}: Props & { inline?: boolean; price?: string | null }) {@@ -78,10 +76,6 @@ function PaidPlanAction({loading={isUpdatingTier && selectedPlan === plan.key}disabled={isUpdatingTier || isStartingTrial}onClick={handleSelect}- data-fast-goal="plan_cta_click"- data-fast-goal-plan={plan.key.toLowerCase()}- data-fast-goal-cycle={billing}- data-fast-goal-surface={goalSurface}>{plan.cta}{price && ` · ${price}`}@@ -113,7 +107,6 @@ function AlternativeTrial({offer,onBillingChange,isStartingTrial,- goalSurface,}: Props & {offer: NonNullable<SubscriptionPlansProps["trialOffer"]>;}) {@@ -129,9 +122,6 @@ function AlternativeTrial({className="h-auto min-w-0 p-0 text-xs text-purple-500"disabled={isStartingTrial}onClick={handleSwitchCycle}- data-fast-goal="paywall_billing_toggle"- data-fast-goal-cycle={offer.billing_cycle}- data-fast-goal-surface={goalSurface}>Try {plan.name} for {offer.duration_days} days instead</Button>diff --git a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/PlanHeader.tsx b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/PlanHeader.tsxindex 4b120e3218..587ad00d70 100644--- a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/PlanHeader.tsx+++ b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/components/PlanHeader.tsx@@ -4,10 +4,7 @@ import { Text } from "@/components/atoms/Text/Text";import type { SubscriptionPlansProps } from "../helpers";import { BillingToggle } from "./BillingToggle";-type Props = Pick<- SubscriptionPlansProps,- "billing" | "onBillingChange" | "goalSurface"-> & {+type Props = Pick<SubscriptionPlansProps, "billing" | "onBillingChange"> & {// A surface with its own title (the platform paywall modal) passes its// heading here, or `null` to keep the heading it already renders outside the// organism. Left undefined, the default onboarding heading renders.diff --git a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/helpers.ts b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/helpers.tsindex 84b294e9e1..fee9aa6dcb 100644--- a/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/helpers.ts+++ b/autogpt_platform/frontend/src/components/organisms/SubscriptionPlans/helpers.ts@@ -20,14 +20,8 @@ export interface SubscriptionPlansProps {selectedPlan?: string | null;isStartingTrial: boolean;trialError: string | null;- // Names the surface for DataFast, so a shared goal never mixes clicks from- // the onboarding paywall and the platform's upgrade modal. SubscriptionPlans- // fills in the default before passing props down.- goalSurface?: string;}-export const DEFAULT_GOAL_SURFACE = "onboarding_paywall";-export type PlanDialog = "compare" | "trial" | null;// Team is contact-sales on every surface, but onboarding's static plan listdiff --git a/autogpt_platform/frontend/src/services/analytics/__tests__/activation-goals.test.ts b/autogpt_platform/frontend/src/services/analytics/__tests__/activation-goals.test.tsdeleted file mode 100644index 0399ff99b7..0000000000--- a/autogpt_platform/frontend/src/services/analytics/__tests__/activation-goals.test.ts+++ /dev/null@@ -1,43 +0,0 @@-import { beforeEach, describe, expect, it, vi } from "vitest";-import {- trackAgentRunGoal,- trackScheduleCreatedGoal,-} from "../activation-goals";--const sendDatafastEvent = vi.hoisted(() => vi.fn());--vi.mock("@/services/analytics", () => ({- analytics: { sendDatafastEvent },-}));--beforeEach(() => {- sendDatafastEvent.mockReset();-});--describe("activation goals", () => {- it("reports a human agent run with its surface and no workflow name", () => {- trackAgentRunGoal("graph-1", "builder");-- expect(sendDatafastEvent).toHaveBeenCalledWith("run_agent", {- id: "graph-1",- surface: "builder",- });- });-- it("reports a new schedule with its surface and no workflow name", () => {- trackScheduleCreatedGoal("graph-2", "library");-- expect(sendDatafastEvent).toHaveBeenCalledWith("schedule_agent", {- id: "graph-2",- surface: "library",- });- });-- it("never lets a failing tag break the action it describes", () => {- sendDatafastEvent.mockImplementation(() => {- throw new Error("tag exploded");- });-- expect(() => trackAgentRunGoal("graph-3", "rerun")).not.toThrow();- });-});diff --git a/autogpt_platform/frontend/src/services/analytics/activation-goals.ts b/autogpt_platform/frontend/src/services/analytics/activation-goals.tsdeleted file mode 100644index b283797a5d..0000000000--- a/autogpt_platform/frontend/src/services/analytics/activation-goals.ts+++ /dev/null@@ -1,40 +0,0 @@-import { analytics } from "@/services/analytics";--/**- * DataFast goals for the activation actions a person takes in the browser.- *- * These exist for marketing attribution (which channel brings users who- * actually run things), so they fire only on human clicks, never for- * server-triggered work. The server-side record of every run lives in- * PostHog (`agent_run_started`, `chat_message_sent`, ...) and the- * `analytics.*` views; this file is only the DataFast mirror of the two goals- * it can see.- *- * `run_agent` used to fire from a single library modal, so builder runs,- * re-runs and the builder's run dialog never counted. Every human run path- * goes through `trackAgentRunGoal` now.- */--export type AgentRunSurface = "library" | "builder" | "rerun";-export type ScheduleSurface = "library" | "builder";--// Only the graph ID goes to DataFast: workflow names are written by people-// and may hold personal data.-export function trackAgentRunGoal(graphID: string, surface: AgentRunSurface) {- sendGoal("run_agent", { id: graphID, surface });-}--export function trackScheduleCreatedGoal(- graphID: string,- surface: ScheduleSurface,-) {- sendGoal("schedule_agent", { id: graphID, surface });-}--function sendGoal(name: string, metadata: Record<string, string>) {- try {- analytics.sendDatafastEvent(name, metadata);- } catch {- // Attribution must never break the action it describes.- }-}diff --git a/autogpt_platform/frontend/src/services/analytics/index.test.ts b/autogpt_platform/frontend/src/services/analytics/index.test.tsindex 1c837871c3..1ec71d9eed 100644--- a/autogpt_platform/frontend/src/services/analytics/index.test.ts+++ b/autogpt_platform/frontend/src/services/analytics/index.test.ts@@ -126,7 +126,7 @@ describe("sendDatafastEvent", () => {it("does not queue pre-consent events", () => {vi.mocked(hasConsentFor).mockReturnValue(false);- analytics.sendDatafastEvent("run_agent", { id: "graph-1" });+ analytics.sendDatafastEvent("tour_cta_click", { label: "signup" });const datafast = vi.fn();window.datafast = datafast;@@ -143,7 +143,7 @@ describe("sendDatafastEvent", () => {const datafast = vi.fn();window.datafast = datafast;- analytics.sendDatafastEvent("run_agent", { id: "graph-1" });+ analytics.sendDatafastEvent("tour_cta_click", { label: "signup" });expect(datafast).not.toHaveBeenCalled();});diff --git a/autogpt_platform/frontend/src/services/analytics/index.tsx b/autogpt_platform/frontend/src/services/analytics/index.tsxindex 11a6d2f098..2b1c42e92c 100644--- a/autogpt_platform/frontend/src/services/analytics/index.tsx+++ b/autogpt_platform/frontend/src/services/analytics/index.tsx@@ -60,8 +60,11 @@ export function SetupAnalytics(props: SetupProps) {/></>) : null}- {/* Datafa.st — onLoad is load-bearing: it delivers the events that were- queued before the script finished loading */}+ {/* DataFast is kept for attribution only: the script records the visit+ and sets the visitor and session cookies that the server-side signup+ goal, the X-Datafast-* headers and the Stripe checkout metadata read.+ In-app behaviour goes to PostHog. onLoad is load-bearing: it delivers+ the /tour events queued before the script finished loading */}{dataFastEnabled ? (<Scriptstrategy="afterInteractive"diff --git a/autogpt_platform/frontend/src/services/experts/useHireFlow.tsx b/autogpt_platform/frontend/src/services/experts/useHireFlow.tsxindex c3353d232d..7397ae448b 100644--- a/autogpt_platform/frontend/src/services/experts/useHireFlow.tsx+++ b/autogpt_platform/frontend/src/services/experts/useHireFlow.tsx@@ -11,7 +11,6 @@ import {buildVoicePreferences,type VoicePickResult,} from "@/components/organisms/VoicePicker/helpers";-import { analytics } from "@/services/analytics";import { trackExperts } from "@/services/experts/experts-analytics";import { invalidateExpertRosterQueries } from "@/services/experts/invalidate-experts";import { useQueryClient } from "@tanstack/react-query";@@ -74,10 +73,6 @@ export function useHireFlow(expert: Expert | null) {data: { template_id: expert.id, surface: "expert_page" },});const result = response.data as HireResult;- analytics.sendDatafastEvent("hire_completed", {- template_id: expert.id,- expert_id: result.expert.id,- });await invalidateExpertRosterQueries(queryClient);pendingCelebrationRef.current = result;setHireResult(result);diff --git a/docs/engineering/activation-metrics.md b/docs/engineering/activation-metrics.mdindex 213db75cbc..5b89b368a6 100644--- a/docs/engineering/activation-metrics.md+++ b/docs/engineering/activation-metrics.md@@ -19,7 +19,7 @@ exists, so a change to one must be made in all four.| **Looker Studio** | GTM dashboards. | Only `analytics.*` views, via the `analytics_readonly` role. || **PostHog** | Funnels, session replay, experiment bucketing and significance testing. | Frontend autocapture + the server-side activation events below. Can also read `analytics.*` as a data-warehouse source. || **LaunchDarkly** | Feature gating (on/off, rollouts, targeting). Not for A/B measurement. | — |-| **DataFast** | Marketing attribution: which channel brought a visitor who signed up, ran an agent, paid. | Browser goals only (`signup`, `paywall_view`, `run_agent`, `schedule_agent`, ...). |+| **DataFast** | Marketing attribution: which channel brought a visitor who signed up and paid. No in-app events; PostHog has those. | Its script (visits, the `/tour` goals, and `tour_cta_click` from the logged-out marketplace sidebar), the server-side `signup` goal, and its visitor ids in Stripe Checkout metadata for purchases. || **Admin dashboard** | Ops views: platform costs, copilot usage export, execution accuracy. | Backend admin routes. || **Sentry** | Errors and stack traces behind `agent_run_finished` with `status: failed`. | — |@@ -296,6 +296,6 @@ missing.- Frontend PostHog is not bootstrapped with flags, so experiment variantsresolve after first paint. `useExperiment.isResolved` papers over this;server-side bootstrap would remove the delay.-- DataFast goals fire only after analytics consent, so they undercount+- DataFast only sees visitors who gave analytics consent, so it undercountsrelative to the server-side events. Use the server-side numbers as truthand DataFast for channel attribution only.diff --git a/docs/engineering/tracking-plan.md b/docs/engineering/tracking-plan.mdindex 5b09ea94c9..0377823c78 100644--- a/docs/engineering/tracking-plan.md+++ b/docs/engineering/tracking-plan.md@@ -5,6 +5,15 @@ sender and one set of properties. [Activation Metrics & Experiments](activation-explains how PostHog fits next to the SQL views, Looker, LaunchDarkly andDataFast; this page is the event contract.+PostHog is the only place for what people do in the app. DataFast gets no+in-app events (SECRT-2718): it keeps its script for visits and marketing+attribution, the `/tour` goals (including `tour_cta_click` with+`surface: marketplace` from the logged-out marketplace sidebar, which shares+the tour's tracking), the server-side `signup` goal+(`datafast-server.ts`), and the DataFast visitor and session ids that ride+along to the backend (`X-Datafast-*` headers) and into Stripe Checkout+metadata, so purchases are attributed to the channel that brought the visitor.+Event names follow the product analytics plan, *Every Second Counts* (owner:Toran), section "What we will record". Where that plan names an event for anaction, this list uses its name; [Differences from the analytics plan](#differences-from-the-analytics-plan)@@ -177,7 +186,7 @@ retried on the next tour visit in that session.| Event | Sender | Status | Required properties | Fires when || --- | --- | --- | --- | --- |-| `onboarding_step_viewed` | browser | live | `step` (`team`, `autopilot`, `role`, `pain_points`, `connect`, `hire`, `preparing`) | A wizard step is shown (once per tab, same keys as the DataFast `onboarding_<step>` goals). The paywall step reports `paywall_viewed` instead. |+| `onboarding_step_viewed` | browser | live | `step` (`team`, `autopilot`, `role`, `pain_points`, `connect`, `hire`, `preparing`) | A wizard step is shown (once per tab). The paywall step reports `paywall_viewed` instead. || `onboarding_completed` | backend | live | — | `ONBOARDING_COMPLETE` is first recorded for the user (`complete_onboarding_step`). || `brain_dump_started` | browser | live | — | Recording starts. || `brain_dump_completed` | browser | live | `input_mode`, `duration_secs` and `finalize_latency_ms` (voice) or `chars` (typed) | A dump was accepted and the wizard advances. `finalize_latency_ms` is the `finalizeBrainDump()` round trip, timed after the upload flush. |@@ -278,8 +287,7 @@ retried on the next tour visit in that session.The paywall funnel in PostHog is `paywall_viewed` → `plan_selected` →`checkout_started` → `payment_succeeded`, with `checkout_abandoned`-as the way out. The onboarding paywall's DataFast goals (`paywall_view`,-`paywall_checkout_cancelled`) keep firing alongside.+as the way out.Browser events captured before PostHog captures (a page's mount effect on afull page load, such as the return from Stripe, runs before `posthog.init`@@ -545,7 +553,7 @@ history PostHog already holds.| Event | Was sent by | Read instead || --- | --- | --- || `subscription_trial_checkout_started` | browser | `checkout_started` with `checkout_kind: trial`, sent by the backend once the trial's Checkout session exists; `surface` is the same `onboarding` / `billing`. `trial_offer_version` is dropped; `trial_started` carries it. |-| `hire_completed` | backend | `expert_hired` (same hire; it now also skips idempotent re-hires). The DataFast `hire_completed` goal is unchanged. |+| `hire_completed` | backend | `expert_hired` (same hire; it now also skips idempotent re-hires). || `hire_flow_completed` | browser | `expert_hired` with `surface: expert_page`. `elapsed_ms` is PostHog's time to convert from `hire_started`; `voice_picked` is dropped. || `onboarding_expert_hired` | browser | `expert_hired` with `surface: onboarding`. The card `position` is on `expert_recommendation_clicked`. || `copilot_message_sent` | backend | `chat_message_sent`, which carries `message_length`. |