Analytics
The AI Playbook uses Cloudflare Web Analytics - a privacy-first analytics platform that doesn’t use cookies or collect personal data. No consent banner needed.
Setup
- Go to Cloudflare Dashboard → Web Analytics
- Click Add a site and enter your domain
- Copy the provided token
- In
astro.config.mjs, find the commented analytics block in theheadsection - Uncomment it and replace
YOUR_TOKENwith your token:
{ tag: 'script', attrs: { defer: true, src: 'https://static.cloudflareinsights.com/beacon.min.js', 'data-cf-beacon': '{"token": "YOUR_TOKEN"}', },},- Deploy to Cloudflare Pages
What Gets Tracked
- Page views (URL, referrer, browser, device type)
- Visit duration
- Bounce rate
- Geographic region (country-level, not city)
Not tracked: Cookies, personal data, scroll depth, mouse movements, keystrokes.
Dashboard
Your analytics dashboard is at Cloudflare Web Analytics. Key metrics to watch:
| Metric | What It Tells You | Good Sign |
|---|---|---|
| Page views | Which content is most popular | Top pages match what you prioritize |
| Visit duration | Are people reading or bouncing | Avg >2 minutes |
| Referrers | Where traffic comes from | GitHub, direct, search |
| Devices | Desktop vs mobile | <40% mobile (this is a reference site) |
Weekly Review
Add this to your weekly maintenance routine:
- Check top 10 pages - do they reflect what’s most useful?
- Check referrers - any new sources of traffic?
- Check mobile percentage - optimize if >50%
- Compare week-over-week - any sudden drops?