Files
dotfiles/dot_agents/skills/cloudflare/references/web-analytics/configuration.md
T
Prad Nukala 6406208b35 shell: fish functions -> ~/.local/bin executables + bash/zsh ports; manage ~/.agents
- 16 cross-shell utilities converted to sh/bash chezmoi executables:
  ai c2p cp-appid extract_agents fab gdc gh-sonr-org-migrate ghg-clone
  ghn gho git-summary launch_omp_livediff_overlay lc-elir mdcp mdp pj
  (ghg-clone not named ghg: unrelated cargo binary owns that name)
- cwd/history helpers stay per-shell: yy c cd clip-last + ghg/ghn/gho
  cd-wrappers in bash/functions/ and zsh/functions/, loaded by rc files
- fish keeps only shell-state functions; converted ones now hit PATH
- cp-appid ignore gating moved to .local/bin path
- dot_agents/skills: 82 skills materialized from dotstate storage so
  dot_claude skill symlinks resolve on fresh bootstrap; dotstate
  profile/symlinks.json released .agents/skills .bashrc .zshrc
2026-08-10 15:15:06 -04:00

77 lines
2.0 KiB
Markdown

# Configuration
## Setup Methods
### Proxied Sites (Automatic)
Dashboard → Web Analytics → Add site → Select hostname → Done
| Injection Option | Description |
|------------------|-------------|
| Enable | Auto-inject for all visitors (default) |
| Enable, excluding EU | No injection for EU (GDPR) |
| Enable with manual snippet | You add beacon manually |
| Disable | Pause tracking |
**Fails if response has:** `Cache-Control: public, no-transform`
**CSP required:**
```
script-src https://static.cloudflareinsights.com https://cloudflareinsights.com;
```
### Non-Proxied Sites (Manual)
Dashboard → Web Analytics → Add site → Enter hostname → Copy snippet
```html
<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "YOUR_TOKEN", "spa": true}'></script>
```
**Limits:** 10 non-proxied sites per account
## SPA Mode
**Enable `spa: true` for:** React Router, Next.js, Vue Router, Nuxt, SvelteKit, Angular
**Keep `spa: false` for:** Traditional multi-page apps, static sites, WordPress
**Hash routing (`#/path`) NOT supported** - use History API routing.
## Token Management
- Found in: Dashboard → Web Analytics → Manage site
- **Not secrets** - domain-locked, safe to expose in HTML
- Each site gets unique token
## Environment Config
```typescript
// Only load in production
if (process.env.NODE_ENV === 'production') {
// Load beacon
}
```
Or use environment-specific tokens via env vars.
## Verify Installation
1. DevTools Network → filter `cloudflareinsights` → see `beacon.min.js` + data request
2. No CSP/CORS errors in console
3. Dashboard shows pageviews after 5-10 min delay
## Rules (Plan-dependent)
Configure in dashboard for:
- **Sample rate** - reduce collection % for high-traffic
- **Path-based** - different behavior per route
- **Host-based** - separate tracking per domain
## Data Retention
- 6 months rolling window
- 1-hour bucket granularity
- No raw export, dashboard only