Skip to content

feat: add Umami analytics, attribution footer & GitHub Sponsors#161

Open
chicogong wants to merge 1 commit into
masterfrom
feat/analytics-attribution
Open

feat: add Umami analytics, attribution footer & GitHub Sponsors#161
chicogong wants to merge 1 commit into
masterfrom
feat/analytics-attribution

Conversation

@chicogong

Copy link
Copy Markdown
Owner

改动内容

1. Umami Analytics(隐私友好统计)

  • tool-chrome.js 新增 injectAnalytics(),覆盖全部 1120 工具页
  • index.html 新增内联 analytics loader
  • 源码中 ID 始终为空,Vercel 部署时通过环境变量 UMAMI_SITE_ID 注入
  • data-domains 使用 location.hostname(不硬编码域名,fork 友好)
  • 主题切换事件跟踪 umami.track("theme_toggle")

2. 底部署名(防搬运)

  • tool-chrome.js 注入 "Powered by WebUtils · chicogong"
  • tool-base.css 新增 #tbCredit 样式(fixed bottom, subtle, hover effect)

3. GitHub Sponsors

  • FUNDING.yml 新增 github: [chicogong](保留原有爱发电)

4. Vercel 部署

  • 新增 build.sh:部署时从 UMAMI_SITE_ID 环境变量注入 ID
  • vercel.json 新增 buildCommand + outputDirectory

激活步骤

  1. 注册 https://cloud.umami.is → 添加网站 → 复制 Website ID
  2. Vercel Dashboard → Settings → Environment Variables → 新增 UMAMI_SITE_ID
  3. Redeploy

文件变更

文件 改动
assets/js/tool-chrome.js +33 analytics 配置 + 注入 + 署名 + 事件跟踪
assets/css/tool-base.css +33 #tbCredit 样式
index.html +15 内联 analytics loader
build.sh +15 Vercel 环境变量注入脚本
vercel.json +2 buildCommand + outputDirectory
.github/FUNDING.yml +1 GitHub Sponsors

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
html-tools Error Error Jun 18, 2026 9:14am

@netlify

netlify Bot commented Jun 18, 2026

Copy link
Copy Markdown

Deploy Preview for localtools ready!

Name Link
🔨 Latest commit 4afbc4d
🔍 Latest deploy log https://app.netlify.com/projects/localtools/deploys/6a33b70e2ce903000836442e
😎 Deploy Preview https://deploy-preview-161--localtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

The `vercel.json` schema validation failed with the following message: should NOT have additional property `public`

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

1. Umami Analytics (privacy-friendly, no cookies)
   - injectAnalytics() in tool-chrome.js covers all 1120 tool pages
   - Inline loader in index.html for the main page
   - ID injected via Vercel env var UMAMI_SITE_ID at deploy time (never in source)
   - data-domains uses location.hostname (fork-friendly, no hardcoded domain)
   - Theme toggle custom event tracking (umami.track)

2. Attribution footer (anti-mirroring)
   - 'Powered by WebUtils · chicogong' injected via tool-chrome.js
   - #tbCredit styled in tool-base.css (fixed bottom, subtle, hover effect)

3. GitHub Sponsors
   - Add github: [chicogong] to FUNDING.yml alongside existing 爱发电

4. Vercel deployment
   - Add build.sh to inject UMAMI_SITE_ID from env var
   - Add buildCommand + outputDirectory to vercel.json
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