mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
- Add resume download button in Hero CTA and Contact section - Migrate react-router v6→v7 and v7→v8 - Restructure specs: UI specs to specs/ui/, v2 specs to specs/v2/ - Add profile-photo assets (jpg + webp) - Update AGENTS.md, spec-v2.md index
66 lines
1.1 KiB
Markdown
66 lines
1.1 KiB
Markdown
# Specification — v2 Analytics
|
|
|
|
> **Document:** `spec-v2-analytics.md`
|
|
> **Version:** 0.1.0
|
|
> **Parent:** `spec-v2.md`
|
|
> **Priority:** P2
|
|
> **Estimate:** ~30 minutes
|
|
|
|
---
|
|
|
|
## Requirement
|
|
|
|
Privacy-friendly analytics — không dùng Google Analytics.
|
|
|
|
---
|
|
|
|
## Options
|
|
|
|
**Option A: Plausible Analytics** (recommended)
|
|
- Lightweight, privacy-first
|
|
- No cookie banner needed
|
|
- Simple script integration
|
|
|
|
**Option B: Umami**
|
|
- Self-hosted option
|
|
- Open source
|
|
- Similar to Plausible
|
|
|
|
**Option C: Custom minimal tracking**
|
|
- Track page views only
|
|
- Store in localStorage
|
|
- Batch send to endpoint (optional)
|
|
|
|
---
|
|
|
|
## Implementation (Plausible)
|
|
|
|
```tsx
|
|
// main.tsx — add script tag
|
|
<script
|
|
defer
|
|
data-domain="yourdomain.com"
|
|
src="https://plausible.io/js/script.outbound-links.js"
|
|
/>
|
|
```
|
|
|
|
Hoặc dùng `react-use-plausible`:
|
|
|
|
```tsx
|
|
import { usePlausible } from 'react-use-plausible'
|
|
|
|
const plausible = usePlausible()
|
|
// Auto pageview tracking
|
|
```
|
|
|
|
Configurable via env var: `ENABLE_ANALYTICS`
|
|
|
|
---
|
|
|
|
## Acceptance
|
|
|
|
- [ ] Page view tracking hoạt động
|
|
- [ ] Không cookie banner
|
|
- [ ] Không ảnh hưởng performance
|
|
- [ ] Configurable via env var (ENABLE_ANALYTICS)
|