Files
shaguabijia-app-server/docs/api/ad/ad-ecpm-report.md
T
guke b23335d5fb @
docs: reorganize api docs into categorized subdirectories and fill missing docs

- Categorize 77 existing api docs into 16 business-domain subdirectories
  (auth/ad/wallet/coupon/compare/savings/signin/tasks/invite/user/
   device/platform/intent/meituan/other) plus admin/ and internal/
- Split admin/ into 7 sub-resource subdirectories (auth/users/wallet/
  withdraws/feedbacks/admins/ad) with 4 single-file docs at root
- Create 21 new docs covering 28 previously undocumented endpoints:
  ad/watch-report, wallet/transfer-auth (3 endpoints), coupon/session+
  stats+completed-today+prompt (7), invite/me+invitees+bind+landing-track,
  user/onboarding (2), platform/flags+ad-config+app-version,
  intent/step+precoupon/step, analytics/events, order/report,
  report/submit+records, feedback/config+records, trace/finalize
- Add mock request/response JSON examples to all new docs
- Create docs/README.md with full category index for LLM navigation
- Update docs/api/README.md: fix all links, add new endpoint rows,
  replace "no doc" markers with actual links
- Fix back-navigation links (./README.md -> ../README.md or
  ../../README.md) in all moved files
@
2026-07-03 14:56:50 +08:00

3.1 KiB
Raw Blame History

POST /api/v1/ad/ecpm-report — 上报本次广告展示的 eCPM(内部收益统计)

所属:Ad 组(前缀 /api/v1/ad | 鉴权:Bearer | ← 返回 API 索引

入参

请求体:EcpmReportIn

字段 类型 必填 说明
ad_type str 广告类型:reward_video(激励视频) / feed(信息流) / draw(历史 Draw 信息流) 等
ad_session_id str|null 客户端生成的广告会话 ID;激励视频与穿山甲 extra.ad_session_id 一致,用于 S2S 缺 eCPM 时匹配。信息流轮播每条展示用各自独立 id(不复用比价会话 id,否则 uq_ad_ecpm_record_session 去重只留一条)
ecpm str 穿山甲 getShowEcpm().getEcpm() 原始字符串,单位是分/千次展示(非元),后端 ÷100 转元参与金币公式
adn str|null 实际投放 ADN(getSdkName),如 pangle(聚合后实际填充的子渠道)
slot_id str|null 实际展示代码位(底层 mediation rit,非客户端配置位)
app_env str|null 我们的穿山甲应用环境:prod(傻瓜比价正式) / test(测试应用)
our_code_id str|null 我们后台配置的代码位 ID(AdConfig 的 104xxx, slot_id 的底层 rit)

user_id 不在 body 里——由 JWT 取(Bearer),防伪造。

出参

响应 200:EcpmReportOut

字段 类型 说明
ok bool 落库即 true

说明

客户端在广告展示后(onAdShowgetShowEcpm())调用,把本次展示的 eCPM 落库做内部收益统计/对账。激励视频每次展示上报一条;信息流轮播每条展示各上报一条(每条独立 ad_session_id),作为「广告收益报表」展示条数/收益的数据源(见 admin-ad-revenue-report)。app_env + our_code_id 供报表按「我们的应用 / 我们配置的代码位」聚合,与 adn/slot_id(底层填充渠道/rit)是两组不同口径。

  • 普通激励视频发奖会先用 S2S 回调自带 ecpm;若缺失,再按 ad_session_id 读取本接口上报的 eCPM;两边都没有则不发并记录异常。
  • best-effort:客户端 fire-and-forget,但普通激励视频若 S2S 缺 eCPM,这条上报会成为发奖依据。
  • ad_ecpm_record 表,report_date 用北京时间当天,供「按用户/按天聚合」对账。
  • 与发奖是两条独立流:发奖走 ad-pangle-callback(穿山甲 S2S,有 trans_id、无 ecpm),本接口客户端上报(有 ecpm、无 trans_id)。两者无公共键,不逐条一一对应,只做按用户/按天聚合口径。
  • eCPM 是每千次展示预估,单条展示预估收益 ≈ ecpm / 1000,且为客户端预估口径,非最终结算。
  • ⚠️ eCPM 单位(分/元)截至 2026-05-31 未最终确认,故 ecpm_raw 原样存字符串;确认后再加一列解析好的数值。
  • 限流:同 IP 120 次/分钟。

相关