修复后台漏斗无数据:埋点默认启用、补全 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
@@ -17,6 +17,14 @@ export function runTests() {
const accountCenterSource = fs.readFileSync(accountCenterPath, "utf8");
const serviceWorkerSource = fs.readFileSync(serviceWorkerPath, "utf8");
const appAnalyticsSource = fs.readFileSync(
path.join(projectRoot, "lib", "app-analytics.ts"),
"utf8",
);
const analyticsRouteSource = fs.readFileSync(
path.join(projectRoot, "app", "api", "analytics", "events", "route.ts"),
"utf8",
);
assert(
accountCenterSource.includes(
@@ -48,4 +56,14 @@ export function runTests() {
accountCenterSource.includes("只有 USDC 可能无法完成授权或支付"),
"payment wallet tab must warn users that Polygon POL/MATIC gas is required in addition to USDC",
);
assert(
!appAnalyticsSource.includes('NEXT_PUBLIC_POLYWEATHER_APP_ANALYTICS === "true"') &&
!analyticsRouteSource.includes('NEXT_PUBLIC_POLYWEATHER_APP_ANALYTICS === "true"'),
"app analytics must be enabled by default so ops funnel can collect data without a fragile production env flag",
);
assert(
accountCenterSource.includes('trackAppEvent("signup_completed"') &&
accountCenterSource.includes('trackAppEvent("dashboard_active"'),
"account center must emit signup_completed and dashboard_active so the ops funnel has top-of-funnel data",
);
}