Skip to content

Improve public-site discovery, homepage clarity and traffic measurement - #5032

Merged
huangruiteng merged 4 commits into
mainfrom
codex/public-site-seo-0925
Sep 25, 2026
Merged

huangruiteng merged 4 commits into
mainfrom
codex/public-site-seo-0925

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

The public homepage and research briefs currently rely on client rendering and share the homepage shell. This change ships their actual content and route-specific metadata in HTML, gives visitors a clearer path into agent setup, and adds visitor-controlled measurement of that path.

  • Refresh the bilingual homepage around the product outcome, supported agent entry points and an explicitly illustrative workflow. Preserve LIVE with a subtle animation and reduced-motion support.
  • Prerender three React pages from their existing components, centralize localized metadata, add canonical/social metadata and source-code structured data, and publish an editorial sitemap plus the documentation sitemap index. Preserve origin-only outbound referrals.
  • Add a practical Codex/Claude Code/DeepSeek Harness guide and improve integration-page search descriptions and internal links.
  • Configure optional GA4 through LOOPX_GA_MEASUREMENT_ID, with PR artifacts and localhost disabled. A bilingual bottom notice explains the purpose, links to Google's data-use information, and presents equally styled Allow/Reject actions. Choices are remembered and can be changed in the footer. No Google tag or events start before consent; withdrawal disables collection, clears this stream's GA cookies and reloads to unload the tag. Events exclude raw query strings, fragments, clipboard contents and workspace data; DNT/GPC override grants.
  • Publish the Google-issued Search Console verification file unchanged. It has no tracking behavior and is excluded from analytics injection and the sitemap.

Validation: site typecheck/builds and full public export; boundary scan; strict reference-docs and bilingual book builds; SEO, blog and publication checks; no-JavaScript content; desktop/mobile and normal/reduced-motion navigation, including 166 published entry links. The updated analytics browser smoke on the complete artifact covers pre-choice isolation, remembered rejection/grant, withdrawal and cookie cleanup, footer replacement, documentation navigation, DNT/GPC, disabled deployment and event redaction. Google requests are intercepted; no production test events were sent.

Visual review: the owner approved concrete homepage and consent-notice desktop/mobile previews before commits. The notice adds only the disclosure and choice; the main product CTA remains usable. Both languages fit the mobile viewport, and the footer control returns keyboard focus to the choice buttons.

The maintenance pass centralizes metadata and removes obsolete hero styling. Scope is the public website and its publishing pipeline. Private traffic research and local artifacts are excluded. Query-language variants of React pages remain client translations of the English canonical URL.

Deployment status: the real GA4 web stream ID is configured in the repository variable, with Enhanced measurement off. The Search Console URL-prefix property has been added. Production collection, ownership verification and sitemap submission remain pending deployment. Passing checks does not establish ranking or traffic growth.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes conclusion (author-owned PR; GitHub cannot record a formal self-approval).
Exact head: f677913.

动机

当前公开站点的 React 内容在旧构建中只留下空的 root,搜索抓取和无脚本访问难以直接看到产品内容;首页的入口说明也不够清晰。把真实页面内容预渲染、补全 canonical 与 sitemap,是可独立验证的改进。流量测量是另一个目标,但不能以搜索改进通过验证为由,一并放行尚未具备访客选择边界的采集。

改动思路

构建器沿用现有 React 页面与共享的路由元数据,在构建时渲染三个公开入口,再从实际产物收集 sitemap URL;浏览器仍由现有入口负责交互。Pages 工作流在站点、文档与案例组装完成后,根据仓库变量给 canonical 公共页注入统一 analytics 客户端。未配置 ID、PR 预览、本地预览以及 DNT/GPC 路径可以保持不采集;但正式部署一旦配置 ID,当前客户端会在用户作出站点级选择之前加载 Google 标签并排队首个 page_view。

具体改动

改动覆盖 25 个文件(+755/-246):页面预渲染与 SEO 构建、首页及中英文文案、Pages 组装、公开站点的 GA4 注入和相应 smoke。旧版构建产物的 root 为空;本 head 的三个入口已经有静态正文、各自的 title/canonical,并生成 sitemap。完整临时 Pages 产物的站点与中英文文档构建、SEO smoke、浏览器桌面与移动端入口测试均通过。用测试 ID 启用注入时,脚本会给 537 个 canonical 公共页加测量标签;这只是本地临时产物检查,没有发送生产流量。

关键代码讲解

  • apps/presentation/site/scripts/build.mjs:21 用同一份 React 组件做 SSR,再写回各入口 HTML;:60 从实际 HTML 中读取 canonical 生成 sitemap,避免把不存在的路径声明为已发布。
  • apps/presentation/site/scripts/add-analytics.mjs:18 只按有效 GA ID 与 canonical 条件注入脚本;仓库变量是部署开关,但不是访客授权。
  • apps/presentation/site/scripts/analytics-client.js:19 初始化 GA4 后立即在 :32 调用 pageView(),:35 随即加载 gtag.js。send_page_view:false 只抑制 config 的自动 pageview,:30 仍显式排队发送。脚本没有默认拒绝的 consent 状态或访客选择入口。

对主干的风险

[P1] 正式站点的测量变量一旦存在,所有未设置 DNT/GPC 的访客打开 canonical 页面,就会走到 analytics-client.js:21-36:在任何站点级同意动作前,page_view 已排队且 Google 标签已加载。README 也承认常规 GA4 首方测量 cookie 可能启用,却仅把 consent/notice 责任留给部署者;当前公开页面与工作流没有实现或验证这一边界。DNT/GPC 是退出信号,不等于每位访客的主动选择。请把自动启用 GA 的部分暂时保持关闭/拆出,或在加载远程标签及发送任何事件前加入明确的默认拒绝、同意/撤回入口及可见告知,并以真实浏览器负例验证“未选择时无远程标签、cookie、事件;同意后才采集,撤回后停止”。可复跑 node apps/presentation/site/scripts/analytics-smoke.mjs <完整站点产物> 加上该负例。Google 对 GA4 cookie 与 consent 模式的说明分别见 https://support.google.com/analytics/answer/11593727?hl=en 和 https://support.google.com/analytics/answer/10000067?hl=en 。

本地 npm run build、SEO/analytics smoke、严格 MkDocs 构建、完整产物 smoke 和浏览器入口 smoke 通过;git diff --check 通过。按当前 Goal 的 wait_for_ci=false 契约,这次没有查询或等待远端 CI,也没有把远端 CI 状态当作阻断原因。现有 analytics smoke 验证事件格式和 DNT/GPC,却没有覆盖上述“普通访客未选择”反例;本地通过不能证明该边界安全。

我的整体评价

预渲染与入口文案改善了长期可发现性和首次访问体验,复用现有页面组件与元数据,没有新增 LoopX 控制面状态或权限语义。规模相对三个实际公开入口和文档组装是可解释的;相关的小重构是让页面元数据继续保持单一来源,未见必须另起框架的理由。但测量路径改变了正式站点对普通访客的默认行为,且当前最关键的选择边界未落地,因此 exact head 还不能放行。修复或拆分该 P1 后,保留已通过的 SEO/浏览器验证,并补上未同意、同意、撤回三条真实浏览器回归,再针对新 head 复审。本结论仅是代码 review,不是合并授权。

English verdict: REQUEST_CHANGES - keep GA4 disabled until a visitor consent/notice boundary is implemented and tested, or split analytics from the otherwise validated SEO and homepage improvements.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
@huangruiteng
huangruiteng merged commit c544b56 into main Sep 25, 2026
7 checks passed
@huangruiteng
huangruiteng deleted the codex/public-site-seo-0925 branch September 25, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant