做产品 PMaker
空格的键盘
写规格 开发 上线 上线之后 事后补 没提埋点 功能做完 发布 想看效果,一条数据都没有 补埋点 · 再等一个版本才有数据 同批走 埋点方案写进规格 和验收标准放在一起 功能和事件一起写 同一个 PR,同一次测 发布前先自测事件 看到上报了才算做完 第 1 天就有曲线可看 好不好,两周内能下结论 埋点是功能的一部分,不是上线之后的补丁

补埋点花的不是补的那半天,是白白过去的那三周。那段时间的用户行为,谁也找不回来。

Track Before Launch

A feature without tracking might as well not have shipped. You don't know how many saw it, how many used it, how many got stuck at which step—you can only say "it shipped" on a hunch.

What you'll run into
  • 上线两周后老板问效果,你翻了半天只能说「用的人好像挺多」
  • 想看新功能的转化,发现只埋了一个点击,中间几步全是空的
  • 补完埋点又要排一个版本,等数据攒够已经是一个月后,那时功能都快下线了
  • 数据有了,但是失败的人有多少、为什么失败,仍然不知道

When to define tracking

The answer is while writing the spec, on the same page as the acceptance criteria. Not after development, and definitely not after launch.

The test is simple: if this feature's spec doesn't answer "which numbers will I look at after launch to judge whether it succeeded," the spec isn't finished. This is the same thing as the three parts of defining a need—the acceptance criteria were always supposed to include the measurable part.

阶段这一步要产出没做的代价
写规格 列出这个功能要回答的 2~3 个问题,以及对应的事件 后面全部要返工
开发 事件和功能写在同一个改动里,一起提测 另开一个版本,多等两周
提测 用调试面板逐条看事件有没有上报、属性对不对 上线了才发现事件名写错,数据白收
上线后第 1 天 先确认数据量级正常,再看结论 拿着漏报一半的数据下判断
Name events as "module_object_action," lowercase with underscores, one convention across the whole site. Pick names on the fly and three months later even you won't recognize what click_btn_2 was.

The minimum tracking set

You don't need dozens of events on day one. Five events per feature answer most questions:

These five events chain into a funnel. Wherever the drop-off is sharpest is where you focus next—no more guessing.

一个功能埋五个点,就能回答绝大部分问题 曝光 有多少人看到了这个入口 分母是它 开始 有多少人点进来 这一段掉得多 → 问题在入口本身 成功 你真正想要的那个数 另外两条必须埋的分支 失败 必须带上原因属性 放弃 停在哪一步 只埋成功不埋失败, 等于只看好消息 上线后一片祥和,因为失败的 人根本没被记下来 命名用「模块_对象_动作」,小写加下划线,全站一套——名字随手起,三个月后你自己都认不出 click_btn_2 是什么。
Name events as "module_object_action," lowercase with underscores, one convention across the whole site. Pick names on the fly and three months later even you won't recognize what click_btn_2 was.

What to specify per event

埋点方案 · 订单批量审批
事件名什么时候报带哪些属性用来回答
order_batch_entry_view批量审批入口出现在视口里页面、角色多少人看到
order_batch_start点开批量审批面板角色、待审数量入口有没有吸引力
order_batch_submit点提交那一下选中条数一次批多少
order_batch_success后端返回成功条数、耗时省了多少时间
order_batch_fail后端返回失败失败原因、条数为什么没成
Name events as "module_object_action," lowercase with underscores, one convention across the whole site. Pick names on the fly and three months later even you won't recognize what click_btn_2 was.

Each event also needs two easily-missed things: who reports it (frontend or backend) and who will look at it. Anything tied to money or permissions is reported by the backend—the frontend can be intercepted, disabled, or spoofed. Events no one will look at shouldn't be tracked; they're just overhead.

Common pitfalls

If you're using AI to write code, put the tracking directly into the same spec so it ships alongside the feature. Rules you have to restate every time are a good fit for the project constraints file (see Distilling Constraints)—no need to remind it each time.