posthog-funnel · git:20260330.0b08998 · 2026-03-30 · sha256 c2a1469eade74b32

posthog-funnel git:20260330.0b08998A

Immutable. This exact content is served forever at /api/v1/blob/c2a1469eade74b32.

---
name: posthog-funnel
description: "Full product funnel stats: social posts, pageviews, CTA clicks, bookings. Use when: 'funnel stats', 'product stats', 'how are cyrano/pieline doing', 'posthog funnel', 'project stats'."
user_invocable: true
---

# Product Funnel Stats

Full marketing funnel per project: social posts -> pageviews -> CTA clicks -> Cal.com bookings.

## Usage

```
/posthog-funnel              # all products
/posthog-funnel cyrano       # single product
/posthog-funnel --days 7     # custom lookback
```

## How it works

Run the unified stats script:

```bash
python3 ~/social-autoposter/scripts/project_stats.py [--project NAME] [--days 30] [--quiet]
```

This queries three data sources in one shot:

| Source | What | Connection |
|--------|------|-----------|
| Posts DB (`DATABASE_URL`) | Social post counts, engagement, platform breakdown | `~/social-autoposter/.env` |
| PostHog API (`POSTHOG_PERSONAL_API_KEY`) | Pageviews, CTA clicks by domain | Project 330744 |
| Bookings DB (`BOOKINGS_DATABASE_URL`) | Cal.com bookings by client | Separate Neon DB |

## Product-to-Domain Mapping

| Product | Main Domain | SEO Landing Pages | Cal slug |
|---------|------------|-------------------|----------|
| Cyrano | `cyrano.systems` | `apartment-security-cameras.com` | `cyrano` |
| PieLine | `getpieline.com` | `aiphoneordering.com` | `pieline` |
| Fazm | `fazm.ai` | — | `fazm` |
| S4L | `s4l.ai` | — | `s4l` |

Domains are read from `config.json -> projects[].website` and `projects[].landing_pages.base_url`.

## PostHog Keys

Two keys, same project (330744):

- `NEXT_PUBLIC_POSTHOG_KEY` (`phc_...`) — project ingestion key, writes events from browsers and webhooks
- `POSTHOG_PERSONAL_API_KEY` (`phx_...`) — personal API key, reads/queries data

## Output

The script prints per-project:
- Social post counts (total, recent, active, removed) with platform breakdown
- Engagement totals (upvotes, comments, views)
- PostHog pageviews with top pages breakdown
- CTA click details (button text, section, timestamp)
- Cal.com booking stats (total, booked, cancelled, real vs test)
- Funnel conversion rates (pageviews -> CTAs -> bookings)