修复后台漏斗无数据:埋点默认启用、补全 signup_completed 和 dashboard_active 事件上报

This commit is contained in:
2569718930@qq.com
2026-05-20 20:13:18 +08:00
parent ef2691a37b
commit 2f9889d63a
4 changed files with 38 additions and 3 deletions
+18 -1
View File
@@ -45,7 +45,7 @@ import {
getCurrentPaymentHost,
isPaymentHostAllowed,
} from "@/lib/payment-host";
import { trackAppEvent } from "@/lib/app-analytics";
import { markAnalyticsOnce, trackAppEvent } from "@/lib/app-analytics";
import { useI18n } from "@/hooks/useI18n";
import { UnlockProOverlay } from "@/components/subscription/UnlockProOverlay";
@@ -927,6 +927,23 @@ export function AccountCenter() {
[currentPaymentHost],
);
useEffect(() => {
if (!authIsAuthenticated || !authUserId) return;
const actorKey = authUserId.toLowerCase();
if (markAnalyticsOnce(`signup_completed:${actorKey}`, "local")) {
trackAppEvent("signup_completed", {
entry: "account_center",
user_id: authUserId,
});
}
if (markAnalyticsOnce(`dashboard_active:${actorKey}`, "session")) {
trackAppEvent("dashboard_active", {
entry: "account_center",
user_id: authUserId,
});
}
}, [authIsAuthenticated, authUserId]);
useEffect(() => {
let canceled = false;
let timeoutId: number | null = null;