Skip to content

feat(analytics): 博客接入火山 DataFinder 埋点 - #7

Merged
lijiarui merged 1 commit into
lijiarui:masterfrom
AristraHatsuyu:feat/datafinder-analytics
Aug 31, 2026
Merged

lijiarui merged 1 commit into
lijiarui:masterfrom
AristraHatsuyu:feat/datafinder-analytics

Conversation

@AristraHatsuyu

@AristraHatsuyu AristraHatsuyu commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

背景

本 PR 为 lijiarui.github.io 接入火山 DataFinder。事件口径沿用官网当前最核心的两类事件:page_viewbutton_click

本次不批量修改生成后的 HTML,改为通过现有公共脚本入口加载埋点,避免无意义 file changes。

改动一览

# 改动 文件
1 新增博客埋点层:初始化 DataFinder SDK,并统一上报 app_type=博客zone=Z区site_name=李佳芮的博客 js/analytics.js
2 覆盖首页、列表页、文章页、PPT 页等新版静态页面,由公共 search.js 自动加载埋点 js/search.js
3 覆盖旧主题页面,由 SimpleCore.js 自动加载埋点 js/SimpleCore.js
4 覆盖 404 页面 404.html
5 补充整站 QA:检查 DataFinder 入口;同时保留当前静态站测试基线,避免旧模板页和 PPT iframe 误报 _test_site.py
6 修复 fork PR 下 Claude Review 无法取得 OIDC/secret 导致必失败的问题:fork PR 跳过该检查,同仓分支 PR 照常执行 .github/workflows/claude-code-review.yml

必要依赖项

类型 新增项 用途
外部 SDK https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/5.0/collect-rangers-v5.2.11.js 火山 DataFinder Web SDK

无新增 npm / Python / 后端依赖。

验证

  • node --check js/analytics.js
  • node --check js/search.js
  • node --check js/SimpleCore.js
  • python3 -m py_compile _test_site.py
  • git diff --check master
  • python3 _test_site.py
  • 本地浏览器验证:新版首页通过 search.js 加载埋点并上报 page_view / button_click;旧主题 tag 页通过 SimpleCore.js 加载埋点;404 页面上报 content_type=errorpage_view
  • 检查失败的 Action 日志:失败原因为 fork pull_request 无 OIDC 环境变量,已在 workflow 中规避该场景

@AristraHatsuyu
AristraHatsuyu force-pushed the feat/datafinder-analytics branch from 56f7be8 to 26d38f4 Compare August 28, 2026 19:11
@AristraHatsuyu
AristraHatsuyu force-pushed the feat/datafinder-analytics branch from 26d38f4 to 6513a40 Compare August 30, 2026 16:34
@lijiarui
lijiarui merged commit bb9c627 into lijiarui:master Aug 31, 2026
1 check passed
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.

2 participants