一键导入
analytics-integration
Configure and manage Umami analytics tracking for the portfolio.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Configure and manage Umami analytics tracking for the portfolio.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Migrate from Next.js 15 to Next.js 16 and handle breaking changes
Configure Content Security Policy and security headers for the portfolio
Deploy Next.js to Cloudflare Workers using OpenNext adapter
Manage the canary token honeypot system for detecting security scanning
Write, debug, and optimize GROQ queries for Sanity CMS in this portfolio
Advanced TypeScript patterns and type safety as used in this portfolio
| name | analytics-integration |
| description | Configure and manage Umami analytics tracking for the portfolio. |
The portfolio uses Umami (cloud.umami.is) for privacy-first analytics. This skill covers configuring, customizing, and reviewing Umami tracking.
src/components/ui/Analytics.tsxnext.config.js (script-src, connect-src)umamicloud.umami.is with a 200 statusAnalytics.tsx and CSP headersUmami supports custom events via the umami global:
// Track a CTA click
window.umami?.track('CTA Clicked', { section: 'hero', button: 'resume' });
// Track a project view
window.umami?.track('Project Viewed', { project: slug, type: 'live' });
// Track a blog post read
window.umami?.track('Blog Read', { post: slug, category });
Where to add events:
'CTA Clicked''Project Viewed''Blog Read''Cert Expanded''Contact Submitted'If the Umami script URL or website ID changes:
src/components/ui/Analytics.tsxnext.config.js:
script-src → add the new Umami domainconnect-src → add the new Umami API domain| Metric | Where to find | What to look for |
|---|---|---|
| Page views | Dashboard → Overview | Trends over time |
| Unique visitors | Dashboard → Overview | Growth trajectory |
| Top pages | Pages → Page views | Which sections get traffic |
| Referrers | Referrers → Source | Where visitors come from |
| Events | Events → Custom events | CTA engagement, project views |
| Bounce rate | Dashboard → Overview | < 50% is good |
| Average duration | Dashboard → Overview | > 2min is good |
The Sanity siteSettings document has analytics fields:
analytics.ga4MeasurementId — GA4 ID (not wired up, schema-only)analytics.plausibleDomain — Plausible domain (not wired up, schema-only)analytics.enableVercelAnalytics — Vercel Analytics toggle (not wired up)These are not connected to the frontend. Only Umami is active.
No data in Umami dashboard:
cloud.umami.isAnalytics.tsx matches the Umami dashboardCustom events not showing:
window.umami is defined (add console.log(window.umami))Duplicate page views:
defer attribute