Skip to content

Fix shot chart all-time data accuracy and add impact tracking#40

Open
joshmerritt wants to merge 1 commit into
masterfrom
claude/relaxed-heisenberg
Open

Fix shot chart all-time data accuracy and add impact tracking#40
joshmerritt wants to merge 1 commit into
masterfrom
claude/relaxed-heisenberg

Conversation

@joshmerritt
Copy link
Copy Markdown
Owner

Summary

  • Fixed ball_impact parameter naming: was sending ball_name instead of project_name, preventing the worker from correlating impact data with other events
  • Added validation guards on all GA4 event handlers to prevent "(not set)" entries from undefined names
  • Added fetchImpactDistribution() to the Cloudflare Worker: queries ball_impact events with real impact_x/impact_y coordinates as custom dimensions from GA4
  • Added "All" time range (days=0startDate: '2020-01-01') across worker and dashboard for true all-time data
  • Updated ShotChart with 3-path dot generation: session localStorage → GA4 impact distribution → seeded random scatter fallback

Test plan

  • Register impact_x and impact_y as custom dimensions (not metrics) in GA4 admin
  • Deploy ga4.js changes — verify ball_impact events send project_name in browser console
  • Deploy worker via wrangler deploy — verify ?days=0 returns impactDistribution array
  • On analytics dashboard, toggle "All" time range and verify shot chart shows real data
  • Toggle between all-time and session modes — both should render dots correctly

🤖 Generated with Claude Code

- Fix ball_impact event to send project_name (was ball_name), matching all
  other GA4 events so the worker can correlate impact data
- Add validation guards to prevent "(not set)" entries from undefined names
- Add fetchImpactDistribution() to worker: queries ball_impact events with
  real impact_x/impact_y coordinates as custom dimensions from GA4
- Add "All" time range option (days=0 → startDate 2020-01-01) across worker
  and dashboard for true all-time data
- Update ShotChart with 3-path dot generation: session localStorage (real
  coords) → GA4 impact distribution (real coords from dimensions) → seeded
  random scatter (fallback)
- Pass impactDistribution through data.js → dashboard → ShotChart

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant