Claude Templates / A-tier · High leverage

Growth & SEO

The Customer Analytics Playbook

First-party event tracking that outlives cookie blockers — and costs nothing per event.

CUSTOMER-ANALYTICS-PLAYBOOK.md · 14 sections · 2,384 words · 19 KB · markdown

Own your funnel data. A single page_events table, a hardened /api/track ingest route, visitor-ID rotation, bot filtering, and signup attribution that survives the referrer being stripped. One source of truth that powers the landing-page HUD, the admin dashboard, and every conversion report.

What's inside

When to use it

Week 4, before you start guessing about the funnel.

Build these first

App Infrastructure

Straight from the file

Trade-off you accept: no out-of-the-box "session replay" or "heatmap." If you need those, layer PostHog OSS on top — but the ingest stays first-party.

Table of contents

  1. 0. Use this spec
  2. 1. Why first-party (vs GA / Mixpanel / Segment)
  3. 2. Architecture
  4. 3. Schema (Supabase)
  5. 4. The atomic upsert RPC
  6. 5. /api/track ingest
  7. 6. Visitor + session IDs
  8. 7. Signup attribution (don't break visitor stability)
  9. 8. Event taxonomy (5–10 events, not 500)
  10. 9. /api/metrics/live (public HUD counters)
  11. 10. Admin analytics dashboard
  12. 11. Churn-risk signal
  13. 12. Common pitfalls
  14. 13. Kickoff prompt

How to run it

Drop CUSTOMER-ANALYTICS-PLAYBOOK.md into your repo, then tell Claude Code: “Read CUSTOMER-ANALYTICS-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

More growth & seo playbooks

← All 28 Claude templates