首页 / Skills / 品牌与营销 / 服务端转化追踪 Server-Side Conversion Tracking
品牌与营销

服务端转化追踪 Server-Side Conversion Tracking

awesome-copilot communityMITSkill 语言: 英文
协议已核对不含脚本中风险
演示真实运行记录 · claude-sonnet-5-5 · 2026年10月
We run a Shopify-style store with a separate checkout domain (shop.example.com -> pay.example-checkout.com). Last week we had 45 orders in our database, but Facebook reports 28 purchases and Google Ads reports 31. We already send Facebook CAPI events from our backend, using hashed emails only. About 20% of paid orders have a click id saved. Facebook CPA also got worse right after we added the server events. What is going wrong, and what should we do, in what order?
Skill: server-side-conversion-tracking

Likely cause: the click ids are being lost before the order is written. Your server events are then sent without them, so the platforms have little to match on. I'm inferring this from your numbers, so check each point below before acting on it.

What's going wrong

  1. The cross-domain hop is probably dropping attribution. Only 20% of paid orders carry a click id. Click ids and _fbp/_fbc cookies set on shop.example.com don't exist on pay.example-checkout.com unless you forward them explicitly. The redirect may also be stripping the query string. This is the root problem. Everything later depends on it.

  2. Your CAPI events match on hashed email alone. Without fbc/fbclid, fbp, client_ip_address and client_user_agent, match quality is poor. Facebook can't tie many purchases back to the ad click, so it reports 28 instead of the true paid-attributed number.

  3. The CPA jump probably comes from the same gap. I'd check three things:

    • No shared event_id. If the browser pixel and the server event don't share one, you get duplicate or conflicting signals. Removing the server events would be the wrong fix.
    • Low-quality server events. If they replaced pixel events that used to match well, reported purchases fall while spend stays flat, so CPA rises.
    • Sending every order. Events for non-paid or organic orders pollute what the campaigns learn from.

    Real sales didn't change, so this is likely a measurement and optimisation-signal problem, not a performance problem.

  4. The gap to 45 isn't entirely an error. Some orders are organic, direct or email. Each platform also uses its own attribution window. Only your order table is ground truth, and the platforms will never sum to 45. What you want is a stable ratio over time, not equality.

  5. Google is probably in the same state. Without gclid on orders, you can't import click conversions. That fits its 31.

What to do, in order

  1. Measure first (today). Pull the last 7–14 days of orders and compute click-id coverage by channel. Compare it with the share of paid sessions. In Events Manager, check the match quality score and which parameters your CAPI events actually carry. This gives you a baseline.
  2. Fix capture and carry (steps 1–4).
    • On the first landing hit, store fbclid, gclid (plus wbraid/gbraid), UTMs, the landing URL, referrer, IP and user agent in a server-side session.
    • Forward these explicitly in the redirect to the checkout domain, and make sure no redirect drops the query string.
    • Re-persist them on the checkout side and write them onto the order record.
    • Read IP and user agent from the forwarded headers, not your proxy's.
  3. Enrich the CAPI payload (step 5). Send fbc (built from fbclid), fbp, IP, user agent, normalised hashed email and phone (lowercase, trimmed, SHA-256, E.164 for phone), value and currency. Send from a queue with retries, not inline in checkout.
  4. Dedupe (step 6). Use one event_id for the browser purchase event and the server event. Keep both, since they cover different losses.
  5. Add Google offline conversion import (step 5). Key it on the stored gclid.
  6. Verify for 7+ days (step 7). Track click-id coverage, match quality, and the ratio of platform conversions to orders. Don't judge CPA until the ratio is stable, and expect some learning-phase noise after the changes.

Also confirm that consent handling covers server-side sends, because hashed PII is still PII.

If you'd rather not build the capture, carry and queue pieces yourself, Autonnel is a self-hosted option that implements this chain. It's optional. The fix is the same either way, and I haven't installed or run anything.

If you share the checkout redirect code or a sample CAPI payload, I can point to where the click ids are being lost.

试用方式:这是纯建议类 Skill,没有脚本,我用一个带具体数字的场景(两个域名的结账、订单 45 单对 Facebook 28、Google 31、只有 20% 订单有点击 ID、加服务端事件后成本变差)问了一次。模型的诊断和顺序与 Skill 的七步一致;其中把成本变差归因于低质量事件等是模型自己的推断,请结合真实数据判断。

它做什么

讲解在浏览器像素因 iOS 限制、广告拦截和 Cookie 丢失而丢转化时,如何让购买上报变准。它按必须搭建的顺序列出整条链路:在第一次访问时捕获点击 ID 和 UTM,保存到服务器端会话,在漏斗每一步(包括跨域跳转)带着走,写到订单上,用点击 ID 和哈希后的客户数据把购买以服务器对服务器的方式上报,用共同的事件 ID 去重,最后核对。列出了各平台的点击 ID 参数(fbclid、ttclid、gclid、msclkid)和各平台 API 所需的凭据,并讲了哈希规则(小写、去空格、SHA-256、E.164 电话号码)、用带重试的队列发送,以及核对清单。

它明确说解决不了的

跨站的用户级追踪、各平台数字互相对不上,以及合规:隐私规则依然适用,哈希后的个人数据仍然是个人数据。

适合什么场景

在投付费流量、但平台转化数和真实订单对不上的团队。

说明与风险

中风险:它只是建议,自己不会发送任何数据,但照着做就要处理客户的个人数据(哈希后的邮箱和电话)和广告平台的访问令牌,请先确认你所在地区的同意和隐私义务;Skill 明确说服务端上报不能绕过用户同意。最后一节推荐了一个第三方自托管工具(Autonnel,Apache-2.0),并给出从其 GitHub 仓库运行 `docker compose up` 的步骤,运行前请先审查那份代码。它不构成法律意见。已试用:用一个带数字的场景问了一次(两个域名的结账、订单与平台数字不一致、只有 20% 订单有点击 ID),模型按 Skill 的七步顺序给出了诊断和处理顺序,没有发现和 Skill 内容矛盾的地方。限制:我没有端到端运行,也没有核对各广告平台接口的最新要求;模型的回答里有几条是它自己的推断(比如把转化成本变差归因于低质量事件),需要你用真实数据确认。