Files
vps_web/docs/forum-post-detail-tracking.md
ddrwode d454699f50 哈哈
2026-02-11 17:38:06 +08:00

4.3 KiB

Forum Post Detail Tracking Spec

Scope

This document defines the tracking events emitted from /forum/post/<post_id> and accepted by /api/event/track.

Pricing CTA links on post detail may include prefill query params for /:

  • provider, region, memory, price, search
  • source_post, source_title (used to show source context in pricing page UI)

CTA A/B Variant

  • Query override: ?cv=control or ?cv=intent
  • Default behavior without cv:
    • Stable assignment by hash of actor (user_id or anonymous visitor_id)
    • Experiment key: forum_post_detail_cta_v1
  • Variant is exposed to frontend via data-cta-variant on <body>.

Common Payload

All events are sent to POST /api/event/track:

  • event_name: snake_case event id
  • label: short context string (max 120 chars server-side)
  • post_id: current post id
  • page_path: current pathname
  • cta_variant: control or intent (when available)
  • device_type: mobile / desktop / tablet (best effort)

Server also appends user_id, visitor_id, referer, ip, timestamp in logs and persists rows into:

  • forum_track_events (event-level detail)
  • forum_track_daily_summary (daily rollup by event_day + cta_variant + event_name)

For SQL examples, see: docs/forum-post-detail-funnel-sql.md.

Admin Dashboard & Export

  • Dashboard: /admin/forum/tracking
  • Weekly dashboard: /admin/forum/tracking/weekly
  • CSV export endpoint: /admin/forum/tracking/export.csv
  • Weekly Markdown endpoint: /admin/forum/tracking/weekly/export.md
  • Export params:
    • days: 1-90
    • variant: all / control / intent / unknown
    • device: all / mobile / desktop / tablet / unknown
    • mode: recent / daily / variants / variant_funnel / device_variants / posts / labels
    • mode=variant_funnel includes variant-level CTR, template submit rate, and template completion rate
    • mode=posts includes post-level template_clicks, template_submits, and template_completion_rate_pct
  • Weekly Markdown params:
    • day: report end day (inclusive, default yesterday UTC)
    • days: window length (3-30, default 7)
    • variant / device: same semantics as dashboard filters

Event Dictionary

event_name Trigger label examples
post_detail_cta_impression Detail page loaded control, intent
post_detail_mobile_bar_impression Mobile sticky conversion bar first visible mobile_bar_visible
post_detail_cta_pricing Main CTA click to pricing page main_compare_plans_control, main_compare_plans_intent
post_detail_cta_new_topic CTA click to create topic / login main_post_requirement_control, sidebar_login_new_topic_intent
post_detail_requirement_template_click Requirement template shortcut click template_new_topic_control, template_login_new_topic_intent
post_detail_requirement_template_submit Requirement template submit succeeded on /forum/post/new from_post_12_to_post_98
post_detail_sidebar_compare Sidebar pricing CTA click sidebar_shortlist_control, sidebar_view_all_plans
post_detail_jump_comments Jump-to-comments click main_jump_comments_control, outline_jump_comments
post_detail_related_click Related topic click post title
post_detail_plan_click Sidebar recommended plan click Provider PlanName
post_detail_inline_plan_click Inline plan card click Provider PlanName
post_detail_inline_plan_view_all Inline panel “view all” click inline_view_all_plans
post_detail_resource_click Resource link click resource track label
post_detail_comment_submit Comment form submit comment_form
post_detail_copy_link Copy link button click copy_permalink
post_detail_copy_link_success Copy succeeded clipboard_api, clipboard_fallback, legacy_exec_command
post_detail_copy_link_failed Copy failed empty_url, clipboard_failed, legacy_failed
post_detail_outline_click Auto-generated outline item click heading anchor id

Suggested Dashboard Cuts

  • CTA conversion by variant:
    • post_detail_cta_impression -> post_detail_cta_pricing
  • Engagement by variant:
    • comment submit rate
    • copy link rate
    • outline interaction rate
  • Top content pathways:
    • related click, resource click, plan click labels