埋点专题 · 预测市场
预测市场
埋点规范
技术侧整理版本,待与 BI 对齐确认。涵盖 5 PV · 9 Click · 2 Callback,共 16 个有效埋点事件,字段与 API 类型对齐。
导出埋点清单 CSV
project_type = predict
SDK @region-lib/data-finder@0.0.37
⏳ 待 BI 对齐确认
更新于 2026-05-26
为什么要精简
⚠
产品原始需求表中存在重复事件(同一 btn_name 跨页面多次列出)和低价值事件(高频按键触发、被动关闭等)。全量照单实现会产生大量噪音,淹没真实转化信号,增加 BI 清洗成本。
相同语义的事件用参数字段区分而非拆成多条。
例:体育大类筛选与联赛筛选合并为 switch_sport_filter,通过 filter_type 区分层级。
以下类型事件不单独埋点:
· 被动关闭行为(可通过漏斗缺口反推)
· 纯 UI 偏好操作(如显示/隐藏资产)
· 高频输入事件(如金额每次按键)
关键业务数据随 Callback 事件一并上报,不单独设立。
例:交易金额、市场 ID 随 trackCallbackCollect 的扩展字段携带,无需单独触发输入事件。
公共参数
所有事件均携带以下字段,通过 setTrackerInfo() 在页面 onMounted 时注入。
| 字段 | 类型 | 必填 | 说明 |
project_type | string | 是 | 固定值 "predict"(Assets 导航页除外,为 "Assets") |
project_name | string | 是 | 页面标识,见 PageView 表 |
btn_type | string | 是(Click) | "button" | "banner" | "link" | "menu" | "tab" | "card" |
btn_name | string | 是(Click) | 按钮英文 ID,用于数据聚合,不随 UI 文案变动 |
btn_label | string | 是(Click) | 按钮展示文案(英文),多态用 | 分隔 |
referrer_url | string | 否(自动注入) | 用户进入当前页面前的来源 URL,来自 document.referrer,SDK 自动采集,无需业务代码手动传 |
PageView 事件 5 个
触发时机:页面 onMounted,先调用 setTrackerInfo({ project_type, project_name }) 再调用 trackPageViewCollect(),无额外参数。
| project_name | 业务页面 | 路由(参考) |
predictCrypto | 加密预测市场列表页 | /predict |
predictSports | 体育预测市场列表页 | /predict/sports |
predictWorld | 世界预测市场列表页 | /predict/world |
predictDetail | 预测市场详情页 | /predict/detail/:id |
PredictionAccount | 持仓账户页 | /predict/position |
Click 事件 9 个
调用方式:$tracker.trackBtnClickCollect({ btn_name, btn_label, ...extra }) 或声明式指令 v-tracker。卡片跳转(market_detail)用 trackClickBeconCollect 防丢点。所有 ID 字段与 API 类型一致:event_id 对应 EventItemVo.eventId,market_id 对应 MarketSubVo.id,均为 string。
预测列表页
project_name: predictCrypto / predictSports / predictWorld
| btn_name | 业务描述 | btn_type | btn_label | 扩展参数 |
switch_market_category |
切换一级分类 Tab |
tab | Crypto | Sports | World |
category_slug: "crypto-assets" | "sports" | "world" |
filter_market |
所有筛选操作(币种 / 体育大类 / 联赛 / 市场类型),通过 filter_type 区分 |
button / menu / tab | — |
filter_type:见下方枚举速查
filter_value:tag slug 或 UI 值
category_id:number(对应 CategoryNode.id,传给 /event/list?categoryId)
|
market_detail |
点击任意卡片进入详情(加密 / 体育 / 世界均用此事件) |
card | — |
event_id: string(EventItemVo.eventId)
event_title: string(EventItemVo.title) |
trade_market_option |
点击卡片内选项(Yes/No 或体育胜平负)发起交易 |
button | Yes | No | Home Win | Draw | Away Win |
event_id: string, market_id: string(MarketSubVo.id)
outcome: string(outcomes 的 key,如 "Yes"/"No"/"team0_win"/"draw"/"team1_win") |
预测市场详情页
project_name: predictDetail
| btn_name | 业务描述 | btn_type | btn_label | 扩展参数 |
trade_market_option |
详情页选项列表选择方向 |
button | Yes | No |
event_id: string, market_id: string, outcome: "Yes" | "No" |
submit_buy_order |
点击买入按钮提交下单(对应 POST /trade/buy) |
button | Buy Yes | Buy No |
event_id: string, market_id: string, outcome: "Yes" | "No"
usdt_amount: string(BuyOrderBody.usdtAmount,单位 USDT,最小 5) |
持仓账户页
project_name: PredictionAccount(导航入口为 Assets)
| btn_name | 业务描述 | project_name | btn_type | btn_label | 扩展参数 |
open_prediction_account | 侧边导航进入预测账户 | Assets | menu | Prediction Account | — |
switch_position_tab | 切换持仓 / 已结算 Tab | PredictionAccount | tab | Positions | Settlements |
tab: "positions" | "settlements"(分别对应 /position/list 和 /settlement/list) |
sell_position | 点击持仓「Sell」按钮 | PredictionAccount | button | Sell |
event_id: string, market_id: string
outcome: "Yes" | "No"(PositionItem.outcomeLabel) |
confirm_sell_position | 确认卖出弹窗 Confirm(对应 POST /trade/sell) | PredictionAccount | button | Confirm |
event_id: string, market_id: string |
Callback 事件 2 个
调用方式:$tracker.trackCallbackCollect({ ret_code, ...extra }),在 POST /trade/buy / POST /trade/sell 响应后触发。ret_code = 0 表示成功;order_status 取自 BuyOrderResult.status。
| 事件 | 触发时机 | project_name | ret_code | 扩展参数 |
| 买入下单结果 |
POST /trade/buy 响应后 |
predictDetail |
接口返回码(0=成功) |
event_id: string(EventItemVo.eventId)
market_id: string(MarketSubVo.id)
outcome: "Yes" | "No"
usdt_amount: string(BuyOrderBody.usdtAmount,单位 USDT)
order_status: "NEW" | "CANCELLED" | "FAILED" | "SUBMITTING"(BuyOrderResult.status)
|
| 卖出下单结果 |
POST /trade/sell 响应后 |
PredictionAccount |
接口返回码(0=成功) |
event_id: string
market_id: string
outcome: "Yes" | "No"(PositionItem.outcomeLabel)
order_status: "NEW" | "CANCELLED" | "FAILED" | "SUBMITTING"
|
枚举值速查
| 值 | 适用事件 |
button | trade_market_option / switch_trade_side / submit_buy_order / sell_position / confirm / cancel |
banner | my_prediction_orders |
tab | switch_market_category / switch_position_tab / filter_market(market_type) |
menu | open_prediction_account / filter_market(sport_category / sport_league) |
card | market_detail / view_position_detail |
link | view_trade_rules |
| 值 | 对应页面 / 路由 |
predictCrypto | 加密预测列表 /predict |
predictSports | 体育预测列表 /predict/sports |
predictWorld | 世界预测列表 /predict/world |
predictDetail | 预测市场详情 /predict/detail/:id |
PredictionAccount | 持仓账户页 /predict/position |
Assets | 侧边资产导航(open_prediction_account 来源) |
| 市场类型 | outcome 可选值 | API 来源 |
| 加密 / 世界预测 | "Yes" | "No" | outcomes Record 的 key;PositionItem.outcomeLabel |
| 体育 moneyline | "team0_win" | "draw" | "team1_win" | MarketSubVo.wdlSlot |
| tab(持仓页) | "positions" | "settlements" | 对应 /position/list 与 /settlement/list |
| 值 | 含义 |
"NEW" | 订单已创建,正在处理 |
"SUBMITTING" | 正在提交到 CLOB |
"PENDING_FUNDING" | 等待资金划转 |
"CANCELLED" | 已取消(含部分成交后取消) |
"FAILED" | 订单失败 |
| filter_type | 含义 | filter_value(tag slug) | category_id | 适用页面 |
"crypto_asset" |
加密币种筛选 |
"bitcoin" | "ethereum" | "solana" | "ripple" | "micro-strategy" |
101 / 102 / 103 / 104 / 105 |
predictCrypto |
"sport_category" |
体育大类切换(L2) |
"world-cup" | "football" |
301 / 302 |
predictSports |
"sport_league" |
联赛切换(L3,football 子项) |
"premier-league" | "champions-league" | "la-liga" | "ligue1" | "serie-a" | "mls" | "bundesliga" |
30201–30207 |
predictSports |
"market_type" |
体育市场类型 Tab(Games/Props) |
"games" | "props" |
—(UI Tab,不传 categoryId) |
predictSports |
Tag 分类树(来自接口)
以下为 GET /ce/pm/v1/api/categories 返回的完整 CategoryNode 数据。filter_value 取 slug,category_id 取 id(传给 /event/list?categoryId),两者都需要随 filter_market 事件上报。
加密资产 slug: crypto-assets · id: 100
| filter_value(slug) | category_id(埋点值) | 中文名 | translateKey | marketCount |
bitcoin | 101 | 比特币 | pmBitcoin | 90 |
ethereum | 102 | 以太坊 | pmEthereum | 15 |
solana | 103 | 索拉纳 | pmSolana | 37 |
ripple | 104 | 瑞波 | pmRipple | 18 |
micro-strategy | 105 | 微策略 | pmMicroStrategy | 133 |
体育 slug: sports · id: 300
| 层级 | filter_value(slug) | category_id(埋点值) | 中文名 | filter_type |
| L2 大类 |
world-cup | 301 | 世界杯 |
sport_category |
| L2 大类 |
football | 302 | 足球 |
sport_category |
| └ L3 | premier-league | 30201 | 英超 | sport_league |
| └ L3 | champions-league | 30202 | 欧冠 | sport_league |
| └ L3 | la-liga | 30203 | 西甲 | sport_league |
| └ L3 | ligue1 | 30204 | 法甲 | sport_league |
| └ L3 | serie-a | 30205 | 意甲 | sport_league |
| └ L3 | mls | 30206 | 美职联 | sport_league |
| └ L3 | bundesliga | 30207 | 德甲 | sport_league |
世界 slug: world · id: 500
| filter_value(slug) | category_id(埋点值) | 中文名 | translateKey | marketCount |
trump | 501 | 特朗普 | pmTrump | 20 |
fed-interest-rate | 502 | 美联储利率 | pmFedInterestRate | 28 |
macro-indicators | 503 | 宏观指标 | pmMacroIndicators | 22 |
inflation | 504 | 通货膨胀 | pmInflation | 15 |
ℹ
体育 L4(各联赛下的 match / event 子类型,如 premier-league-match)当前埋点方案不区分到 L4,filter_type = "sport_league" 取 L3 slug 即可。若后续需要上报更细粒度,可新增 filter_sub_type 字段。