事件规范
8 类实体,185 个事件。
每个事件先问:它碰到哪几类实体?碰到谁,就必须带谁的连接键。字段名一律以 Lexicon 为准。
连接键像快递单号。下单、付款、到账,凭同一个单号串起来。
每类实体:Lexicon 已有 / 提议新增
| 实体 | Lexicon 已有字段 | 提议新增字段 | 相关事件 | 已带连接键 | 缺口 |
|---|---|---|---|---|---|
| 人 | 41 | 7 | 185 | 146 | 39 |
| 设备 | 10 | 2 | 185 | 185 | 0 |
| 订单 | 75 | 17 | 42 | 40 | 2 |
| 支付服务 | 17 | 0 | 23 | 18 | 5 |
| 模型服务 | 32 | 27 | 53 | 53 | 0 |
| 网络服务 | 19 | 5 | 42 | 41 | 1 |
| 模块互动 | 76 | 22 | 122 | 122 | 0 |
| 用户输入和互动 | 50 | 20 | 49 | 47 | 2 |
| 其他(meta) | 64 | 62 |
缺口事件在下方卡片里用黄色"缺"标出。
三方对账
| 来源 | 事件数 | 说明 |
|---|---|---|
| Mixpanel Lexicon(4072898) | 146 | 基准。本规范 146 个全部覆盖,Lexicon 列出的字段一个不少 |
| 代码目录 v1.7 | 155 | vpn/js 事件注册表(109 客户端 + 46 服务端) |
| D7 文档 | 146 | 其中 123 个也在代码里,23 个只在文档 |
| 本方案合计 | 185 | Lexicon 146 + 提议 39 |
8 类实体字段
每个字段写清谁写、怎么写、怎么保护。
人 · 连接键 distinct_id / account_id
Lexicon 已有 41 个字段,提议新增 7 个。146/185 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
distinct_id | Lexicon | string | acc_9f2 | 必填 | 客户端 | 事件(identify 后 = account_id) | 普通 | 146 个 |
account_id / user_id / canonical_user_id | Lexicon | string | acc_9f2 | 登录后必填 | 服务端 | 事件 + profile set_once | 普通 | 146 个 |
$email / email | Lexicon | string | a***@gmail.com | 可选 | 服务端 | profile set | 敏感:只存打码值(待确认) | 146 个 |
$name | Lexicon | string | Mia | 可选 | 服务端 | profile set | 只存昵称 | 0 个 |
phone_masked | 提议 | string | +1 ***-***-0123 | 可选 | 服务端 | profile set | 敏感:只存后 4 位 | 0 个 |
auth_method | Lexicon | string | 必填 | 服务端 | profile set_once(即 signup_method) | 普通 | 7 个 | |
registered_at | Lexicon | datetime | 2026-10-29T08:00Z | 必填 | 服务端 | profile set_once(即 signup_at) | 普通 | 2 个 |
first_acquisition_channel | Lexicon | string | tiktok | 可选 | 服务端 | profile set_once(首次 UTM) | 普通 | 0 个 |
referrer_domain | Lexicon | string | google.com | 可选 | 客户端 | 事件;首值 set_once | 普通 | 1 个 |
country / region | 提议 | string | US | 必填 | 服务端 | profile set | IP 推导 | 0 个 |
last_locale / locale | Lexicon | string | en | 必填 | 客户端 | profile set | 普通 | 146 个 |
gender_preference | 提议 | string | female | 可选 | 服务端 | profile set | 普通 | 1 个 |
age_gate_at | 提议 | datetime | 2026-10-29T08:01Z | 必填 | 服务端 | profile set_once | 普通 | 0 个 |
current_plan | Lexicon | string | premium | 必填 | 服务端 | profile set(即 plan) | 普通 | 0 个 |
current_entitlement_end_at | Lexicon | datetime | 2026-11-28 | 条件 | 服务端 | profile set(即 plan_expires_at) | 普通 | 0 个 |
coin_balance | 提议 | integer | 950 | 必填 | 服务端 | profile set | 普通 | 1 个 |
lifetime_paid_usd | 提议 | number | 19.99 | 必填 | 服务端 | profile increment(只加实付,排除 is_test) | 普通 | 0 个 |
first_payment_at | Lexicon | datetime | 2026-10-29 | 条件 | 服务端 | profile set_once | 普通 | 0 个 |
last_paid_at | 提议 | datetime | 2026-10-29 | 条件 | 服务端 | profile set | 普通 | 0 个 |
paid_order_count | 提议 | integer | 1 | 必填 | 服务端 | profile increment | 普通 | 0 个 |
has_successful_payment | Lexicon | boolean | true | 必填 | 服务端 | profile set | 普通 | 0 个 |
is_test | Lexicon | boolean | true | 必填 | 服务端 | profile set + 事件(旧名 is_sandbox 已弃用) | 普通 | 150 个 |
invitation_id | Lexicon | string | inv_1 | 可选 | 服务端 | profile set_once(即 invite_code) | 普通 | 5 个 |
inviter_user_id | Lexicon | string | acc_11 | 可选 | 服务端 | profile set_once | 普通 | 3 个 |
ai_cluster_* / label_version | 提议 | string | ai_cluster_topic=romance / v1 | 可选(以后) | 后端回写 | profile set | 以后可选;只写标签,不写原文 | 0 个 |
白话:profile 是贴在人身上的标签。set 会覆盖,set_once 只写第一次,increment 累加。
设备 · 连接键 device_id
Lexicon 已有 10 个字段,提议新增 2 个。185/185 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
device_id / $device_id | Lexicon | string | d_8a1 | 自动 | 客户端 | 事件 | 普通 | 146 个 |
cookie_id | Lexicon | string | c_2 | 自动 | 客户端 | 事件 + profile | 普通 | 146 个 |
ua | Lexicon | string | Mozilla/5.0 … | 必填 | 客户端/服务端 | 事件 + profile set | 普通;即 user_agent | 157 个 |
$browser / $browser_version / $os | Lexicon | string | Chrome / 130 / iOS | 自动 | SDK | 事件 | 普通 | 0 个 |
os_version | 提议 | string | 18.1 | 可选 | 由 ua 解析 | 事件 | 普通 | 0 个 |
device_type | 提议 | string | mobile | 必填 | 客户端 | 事件 | 普通 | 0 个 |
$screen_width / $screen_height | Lexicon | integer | 390 / 844 | 自动 | SDK | 事件 | 普通 | 0 个 |
platform | Lexicon | string | pwa | 必填 | 客户端 | 事件 + super property(web / pwa / app) | 普通 | 146 个 |
app_version / app_build_id / sdk_version | Lexicon | string | 2026.10.29-a1 | 必填 | 客户端 | super property | 普通 | 147 个 |
ip_address | Lexicon | string | 203.0.113.4 | 自动 | 服务端 | 事件 + profile | 敏感;Mixpanel 用它推导地区 | 146 个 |
$city / mp_country_code | 提议 | string | US | 自动 | Mixpanel | IP 推导 | 代理需转发真实 IP(待确认) | 0 个 |
订单 · 连接键 order_id
Lexicon 已有 75 个字段,提议新增 17 个。40/42 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
order_id | Lexicon | string | ord_7f3 | 必填 | 服务端 | 事件 | 普通 | 37 个 |
checkout_id / quote_id | Lexicon | string | chk_12 | 条件 | 客户端/服务端 | 事件 | 普通 | 30 个 |
order_status | Lexicon | string | paid | 必填 | 服务端 | 事件 | 普通 | 17 个 |
order_items / order_item_id | Lexicon | list / string | […] | 条件 | 服务端 | 事件 | 普通 | 3 个 |
product_id | Lexicon | string | premium_month | 必填 | 服务端 | 事件(即 sku) | 普通 | 13 个 |
plan_id / coin_pack_id | Lexicon | string | premium / coins_1000 | 条件 | 服务端 | 事件 | 普通 | 20 个 |
order_amount_minor / amount_minor | Lexicon | integer | 1999 | 必填 | 服务端 | 事件(即 amount;分为单位) | 普通 | 10 个 |
currency / currency_exponent | Lexicon | string / integer | USD / 2 | 必填 | 服务端 | 事件 | 普通 | 16 个 |
coin_quantity | Lexicon | integer | 1000 | 条件 | 服务端 | 事件(即 coins) | 普通 | 19 个 |
quota_type / quota_remaining | Lexicon | string / integer | messages / 0 | 条件 | 服务端 | quota_blocked | 普通 | 1 个 |
支付服务 · 连接键 payment_attempt_id
Lexicon 已有 17 个字段,提议新增 0 个。18/23 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
payment_attempt_id | Lexicon | string | pa_3 | 必填 | 服务端 | 事件(即 payment_id) | 普通 | 23 个 |
payment_provider | Lexicon | string | xsdk | 必填 | 服务端 | 事件(即 payment_channel) | 普通 | 24 个 |
transaction_id / provider_charge_id | Lexicon | string | txn_99 | 条件 | 服务端(回调) | 事件(即 provider_txn_id) | 普通 | 10 个 |
provider_event_id | Lexicon | string | evt_1 | 条件 | 服务端(回调) | 事件 | 普通 | 3 个 |
payment_status | Lexicon | string | succeeded | 必填 | 服务端 | 事件 | 普通 | 2 个 |
payment_method_id | Lexicon | string | pm_1 | 可选 | 服务端 | 事件 | 普通 | 3 个 |
error_code | Lexicon | string | card_declined | 条件 | 服务端 | 事件 | 普通 | 35 个 |
is_test | Lexicon | boolean | true | 必填 | 服务端 | 事件(旧名 is_sandbox 已弃用;收入排除 true) | 普通 | 150 个 |
模型服务 · 连接键 attempt_id
Lexicon 已有 32 个字段,提议新增 27 个。53/53 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
attempt_id | Lexicon | string | att_1 | 必填 | 服务端 | 事件(即 task_id,取餐号) | 普通 | 53 个 |
operation_type / operation_id | Lexicon | string | chat / msg_5 | 必填 | 服务端 | 事件 | 普通 | 3 个 |
provider | Lexicon | string | byteplus | 必填 | 服务端 | 事件(byteplus / aws_bedrock) | 普通 | 5 个 |
model_id / model_config_version | Lexicon | string | seed-1.6 | 必填 | 服务端 | 事件 | 普通 | 7 个 |
billing_account | 提议 | string | byteplus-dev-01 | 必填 | 服务端 | 事件 | 普通 | 1 个 |
input_tokens / output_tokens / cache_tokens | Lexicon | integer | 820 / 140 / 0 | 必填 | 服务端 | 事件 | 普通 | 3 个 |
media_seconds | 提议 | number | 5 | 条件 | 服务端 | 事件(视频) | 普通 | 1 个 |
started_at / ended_at / first_output_at | Lexicon | datetime | … | 必填 | 服务端 | 事件 | 普通 | 4 个 |
attempt_status / finish_reason / error_code | Lexicon | string | ok / stop | 必填 | 服务端 | 事件 | 普通 | 36 个 |
cost_kind / charge_amount_minor / cost_currency | Lexicon | string / integer | token / 3 | 条件 | 服务端 | model_charge_posted(扣费记录,优先) | 普通 | 1 个 |
模型返回(子表)
原文不进 Mixpanel。原文在你们后端,用 message_id / attempt_id / response_id 回查。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 带它的事件 | 说明 |
|---|---|---|---|---|---|---|---|
response_id | 提议 | string | resp_1 | 必填 | 服务端 | 三个都带 | |
message_id | Lexicon | string | msg_6 | 条件 | 服务端 | chat_reply_completed, model_attempt_finished | 和 AWS 原文按 message_id / attempt_id 关联 |
finish_reason | Lexicon | string | stop | 必填 | 服务端 | 三个都带 | stop / length / filter / error |
output_chars | 提议 | integer | 420 | 必填 | 服务端 | 三个都带 | |
output_tokens | Lexicon | integer | 140 | 必填 | 服务端 | 三个都带 | |
time_to_first_token_ms | 提议 | integer | 900 | 必填 | 服务端 | 三个都带 | 由 started_at、first_output_at 算出 |
total_latency_ms | 提议 | integer | 2300 | 必填 | 服务端 | 三个都带 | |
stream_chunks | 提议 | integer | 35 | 可选 | 服务端 | chat_reply_completed, model_attempt_finished | |
language_detected | 提议 | string | en | 可选 | 服务端 | chat_reply_completed, model_attempt_finished | |
safety_filtered | 提议 | boolean | false | 必填 | 服务端 | 三个都带 | |
safety_category | 提议 | string | none | 条件 | 服务端 | 三个都带 | 被过滤时必填 |
refusal | 提议 | boolean | false | 必填 | 服务端 | 三个都带 | |
truncated | 提议 | boolean | false | 必填 | 服务端 | 三个都带 | |
retry_count | 提议 | integer | 0 | 必填 | 服务端 | 三个都带 | |
fallback_model_used | 提议 | string | 条件 | 服务端 | 三个都带 | 代码有 fallback_tier,待确认是否同义 | |
output_count | Lexicon | integer | 4 | 条件 | 服务端 | generation_completed, model_attempt_finished | 图片/视频 |
resolution | 提议 | string | 1024x1024 | 条件 | 服务端 | generation_completed, model_attempt_finished | |
duration_s | 提议 | number | 5 | 条件 | 服务端 | generation_completed, model_attempt_finished | 视频 |
format | 提议 | string | mp4 | 条件 | 服务端 | generation_completed, model_attempt_finished | |
nsfw_score_bucket | 提议 | string | 0-0.2 | 条件 | 服务端 | generation_completed, model_attempt_finished | 只记分档 |
response_contains_media | 提议 | boolean | false | 可选 | 服务端 | chat_reply_completed | |
response_contains_cta | 提议 | boolean | false | 可选 | 服务端 | chat_reply_completed | 回复里有没有引导付费或生图 |
persona_consistency | 提议 | string | consistent | 可选(以后) | 后端 | 离线表 | 以后可选;由你们后端分桶得出 |
质量信号:
| 信号 | 怎么拿 |
|---|---|
| user_regenerated | message_regenerated 事件(带 regeneration_reason、parent_message_id) |
| user_liked / user_disliked | 代码有 liked / unliked,待确认挂在哪个事件 |
| copied | 代码有 copied,待确认事件名 |
| continued_chat_within_60s | BI 计算:回复后 60 秒内有 chat_submitted |
网络服务 · 连接键 request_id
Lexicon 已有 19 个字段,提议新增 5 个。41/42 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
request_id / parent_request_id | Lexicon | string | req_4c | 必填 | 客户端/服务端 | 事件 | 普通 | 27 个 |
trace_id / span_id | Lexicon | string | tr_1 | 可选 | 服务端 | 事件 | 普通 | 146 个 |
endpoint | 提议 | string | /api/v1/chat | 必填 | 服务端 | 事件(只记路由模板) | 普通 | 0 个 |
http_status | 提议 | integer | 502 | 条件 | 服务端 | 事件 | 普通 | 0 个 |
latency_ms | 提议 | integer | 2300 | 必填 | 客户端/服务端 | 事件 | 普通 | 4 个 |
retry_count | 提议 | integer | 1 | 可选 | 客户端 | 事件 | 普通 | 3 个 |
connection_type | 提议 | string | 4g | 可选 | 客户端 | 事件 | 普通 | 0 个 |
via_proxy | 提议 | boolean | true | 可选 | 客户端 | super property(是否经 t.peersoft.ai) | 普通 | 0 个 |
error_stage / error_code | Lexicon | string | upstream / timeout | 条件 | 客户端/服务端 | 事件 | 普通 | 35 个 |
client_clock_offset_ms / ingested_at | Lexicon | integer / datetime | -120 | 自动 | 服务端 | 事件 | 普通 | 146 个 |
模块互动 · 连接键 page_view_id / impression_id
Lexicon 已有 76 个字段,提议新增 22 个。122/122 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
session_id | Lexicon | string | sess_1 | 必填 | 客户端 | 事件 | 普通 | 146 个 |
page_view_id / page_path | Lexicon | string | pv_21 | 必填 | 客户端 | 事件 | 普通 | 146 个 |
app_surface / discovery_surface / media_surface | Lexicon | string | home_grid | 条件 | 客户端 | 事件 | 普通 | 33 个 |
impression_id / position | Lexicon | string / integer | imp_3 / 3 | 条件 | 客户端 | 事件 | 普通 | 16 个 |
interaction_id / event_sequence | Lexicon | string / integer | int_9 / 14 | 必填 | 客户端 | 事件 | 普通 | 148 个 |
visible_duration_ms / visible_ratio | Lexicon | integer / number | 4200 / 0.8 | 条件 | 客户端 | 事件(曝光、停留) | 普通 | 1 个 |
entry_point | Lexicon | string | home | 条件 | 客户端 | 事件 | 普通 | 7 个 |
用户输入和互动 · 连接键 conversation_id / message_id
Lexicon 已有 50 个字段,提议新增 20 个。47/49 个相关事件已带连接键。
| 字段 | Lexicon | 类型 | 例子 | 必填 | 来源 | 写法 | 隐私 | 带它的事件 |
|---|---|---|---|---|---|---|---|---|
conversation_id | Lexicon | string | conv_8 | 必填 | 客户端/服务端 | 事件 | 普通 | 35 个 |
message_id / parent_message_id | Lexicon | string | msg_5 | 条件 | 客户端/服务端 | 事件 | 普通 | 32 个 |
turn_id | Lexicon | string | turn_12 | 必填 | 客户端/服务端 | 事件 | 普通 | 18 个 |
turn_index | 提议 | integer | 4 | 必填 | 服务端 | 事件 | 普通 | 32 个 |
query | 提议 | string | romance | 条件 | 客户端 | 事件 | 敏感:先打码邮箱/电话/卡号/证件号,≤200 字 | 1 个 |
query_length / input_length | Lexicon | integer | 12 | 必填 | 客户端 | 事件 | 普通 | 3 个 |
prompt_length | 提议 | integer | 80 | 条件 | 客户端 | 事件 | prompt 原文不进 Mixpanel | 1 个 |
chat_input_mode / input_source | Lexicon | string | text | 必填 | 客户端 | 事件(即 input_method) | 普通 | 13 个 |
query_revision | Lexicon | integer | 2 | 可选 | 客户端 | 事件(编辑次数) | 普通 | 11 个 |
regeneration_reason | Lexicon | string | user_retry | 条件 | 客户端 | 事件 | 普通 | 3 个 |
对话 conversation
| 字段 | Lexicon | 类型 | 例子 | 必填 | 说明 |
|---|---|---|---|---|---|
conversation_id | Lexicon | string | conv_8 | 必填 | |
character_id | Lexicon | string | char_3 | 必填 | |
conversation_type | 提议 | string | multi | 必填 | single / multi / group |
conversation_started_at | 提议 | datetime | 2026-10-29T08:02Z | 必填 | 即 started_at |
entry_point | Lexicon | string | home_grid | 必填 | 即 entry_source |
轮次 turn
| 字段 | Lexicon | 类型 | 例子 | 必填 | 说明 |
|---|---|---|---|---|---|
turn_id | Lexicon | string | turn_12 | 必填 | |
turn_index | 提议 | integer | 4 | 必填 | 1..n |
turn_role | 提议 | string | user | 必填 | user / assistant |
parent_message_id | Lexicon | string | msg_11 | 条件 | 即 parent_turn_id |
is_first_turn | 提议 | boolean | false | 必填 | |
previous_turn_gap_s | 提议 | number | 18 | 条件 | 和上一轮的间隔 |
对话汇总
| 字段 | Lexicon | 类型 | 例子 | 必填 | 说明 |
|---|---|---|---|---|---|
turns_so_far | 提议 | integer | 8 | 必填 | |
user_turns / assistant_turns | 提议 | integer | 4 / 4 | 必填 | |
conversation_duration_s | 提议 | number | 310 | 必填 | |
is_deep | 提议 | boolean | false | 必填 | turn_index ≥ N(推荐默认 10) |
ended_reason | 提议 | string | left | 必填 | left / limit / paywall / error / switch_character |
last_turn_index | 提议 | integer | 8 | 必填 |
白话:每个聊天事件都带 conversation_id、message_id、turn_index。所以单轮还是多轮、第 N 轮掉多少人、北极星,都能直接算。
全部事件
搜事件名、中文名或字段。
列表按需加载 spec.json,首屏不卡。
加载中…(直接双击打开文件时,浏览器可能拦住加载,请用 http 服务打开)
事件 CSV(含 8 个实体列) · 字段 CSV(含 lexicon_status) · Markdown · 需求 CSV
名词表
| 名词 | 白话和例子 |
|---|---|
| 事件 | 用户做的一件事被记下来。像收银小票上的一行。 |
| 属性 | 这件事的细节。像小票上的价格和时间。 |
| 实体 | 被记录的一类东西。像学校里的"学生""班级""课程"。 |
| 用户属性(profile) | 贴在人身上的标签,会被更新。像会员卡上的等级。 |
| set / set_once / increment | 改写 / 只写第一次 / 累加。像改地址 / 记生日 / 积分加一。 |
| 连接键 | 把两张表连起来的编号。像快递单号连起下单、发货、签收。 |
| Lexicon | Mixpanel 里的字段字典。像词典,名字和类型以它为准。 |
事件规范 签字
确认人:研发 · 产品
意见:______________________
打印后勾选。本页不收集数据。