feat: Retention(留存)分析
1. 最受欢迎的功能
- 哪些功能用户使用最频繁?
- 新闻、事件、个股、模拟盘的使用对比
2. 用户行为路径
- 用户从哪里进入?
- 在每个页面停留多久?
- 从哪个环节流失?
3. 内容偏好
- 什么类型的新闻最受欢迎?
- 用户关注哪些行业?
- 哪些事件获得最多关注?
Revenue(收入)转化
1. 付费转化漏斗
个人中心查看 →
自选股/关注事件使用 →
订阅页面查看 →
升级按钮点击 →
(付费转化)
2. 模拟盘转化分析
模拟盘进入 →
搜索股票 →
下单操作 →
持续使用 →
(付费转化)
This commit is contained in:
@@ -17,6 +17,7 @@ import EventModals from './components/EventModals';
|
||||
// 导入自定义 Hooks
|
||||
import { useEventData } from './hooks/useEventData';
|
||||
import { useEventFilters } from './hooks/useEventFilters';
|
||||
import { useCommunityEvents } from './hooks/useCommunityEvents';
|
||||
|
||||
import { logger } from '../../utils/logger';
|
||||
import { useNotification } from '../../contexts/NotificationContext';
|
||||
@@ -28,7 +29,7 @@ import { RETENTION_EVENTS } from '../../lib/constants';
|
||||
const Community = () => {
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useDispatch();
|
||||
const { track } = usePostHogTrack(); // PostHog 追踪
|
||||
const { track } = usePostHogTrack(); // PostHog 追踪(保留用于兼容)
|
||||
|
||||
// Redux状态
|
||||
const { popularKeywords, hotEvents } = useSelector(state => state.communityData);
|
||||
@@ -47,6 +48,9 @@ const Community = () => {
|
||||
const [selectedEvent, setSelectedEvent] = useState(null);
|
||||
const [selectedEventForStock, setSelectedEventForStock] = useState(null);
|
||||
|
||||
// 🎯 初始化Community埋点Hook
|
||||
const communityEvents = useCommunityEvents({ navigate });
|
||||
|
||||
// 自定义 Hooks
|
||||
const { filters, updateFilters, handlePageChange, handleEventClick, handleViewDetail } = useEventFilters({
|
||||
navigate,
|
||||
@@ -63,13 +67,26 @@ const Community = () => {
|
||||
}, [dispatch]);
|
||||
|
||||
// 🎯 PostHog 追踪:页面浏览
|
||||
// useEffect(() => {
|
||||
// track(RETENTION_EVENTS.COMMUNITY_PAGE_VIEWED, {
|
||||
// timestamp: new Date().toISOString(),
|
||||
// has_hot_events: hotEvents && hotEvents.length > 0,
|
||||
// has_keywords: popularKeywords && popularKeywords.length > 0,
|
||||
// });
|
||||
// }, [track]); // 只在组件挂载时执行一次
|
||||
|
||||
// 🎯 追踪新闻列表查看(当事件列表加载完成后)
|
||||
useEffect(() => {
|
||||
track(RETENTION_EVENTS.COMMUNITY_PAGE_VIEWED, {
|
||||
timestamp: new Date().toISOString(),
|
||||
has_hot_events: hotEvents && hotEvents.length > 0,
|
||||
has_keywords: popularKeywords && popularKeywords.length > 0,
|
||||
});
|
||||
}, [track]); // 只在组件挂载时执行一次
|
||||
if (events && events.length > 0 && !loading) {
|
||||
communityEvents.trackNewsListViewed({
|
||||
totalCount: pagination?.total || events.length,
|
||||
sortBy: filters.sort,
|
||||
importance: filters.importance,
|
||||
dateRange: filters.date_range,
|
||||
industryFilter: filters.industry_code,
|
||||
});
|
||||
}
|
||||
}, [events, loading, pagination, filters, communityEvents]);
|
||||
|
||||
// ⚡ 首次访问社区时,延迟显示权限引导
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user