Files
dotfiles/dot_agents/skills/cloudflare/references/web-analytics/gotchas.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

2.0 KiB

Web Analytics Gotchas

Critical Issues

SPA Navigation Not Tracked

Symptom: Only initial pageload counted
Fix: Add spa: true:

<script data-cf-beacon='{"token": "TOKEN", "spa": true}' ...></script>

CSP Blocking Beacon

Symptom: Console error "Refused to load script"
Fix: Allow both domains:

script-src 'self' https://static.cloudflareinsights.com https://cloudflareinsights.com;

Hash-Based Routing Unsupported

Symptom: #/path URLs not tracked
Fix: Migrate to History API (BrowserRouter, not HashRouter). No workaround for hash routing.

No Data Appearing

Causes & Fixes:

  1. Delay - Wait 5-15 minutes
  2. Wrong token - Verify matches dashboard exactly
  3. Script blocked - Check DevTools Network tab for beacon.min.js
  4. Domain mismatch - Dashboard site must match actual URL

Auto-Injection Fails

Cause: Cache-Control: no-transform header
Fix: Remove no-transform or install beacon manually

Duplicate Pageviews

Cause: Multiple beacon scripts
Fix: Keep only one beacon per page

Configuration Issues

Issue Fix
10-site limit reached Delete old sites or proxy through CF (unlimited)
Token not recognized Use exact alphanumeric token from dashboard

Framework-Specific

Next.js Hydration Warning

<script suppressHydrationWarning ... />

Gatsby Window Undefined

Use gatsby-browser.js to load client-side only.

Limits

Resource Limit
Non-proxied sites 10
Proxied sites Unlimited
Data retention 6 months
Ingestion delay 5-10 min
API access None (dashboard only)

When NOT to Use Web Analytics

Use alternatives if you need:

  • Custom event tracking
  • Real-time data
  • User-level tracking
  • Conversion funnels
  • Data export/API access

Web Analytics excels at: Core Web Vitals, basic traffic, privacy compliance, free unlimited pageviews.