The ask (from Wed Sep 24 call)One number: cost per new patient by marketing channel.▾
"How much does a new patient cost me? ... We need a system in place where we know of the calls that are being driven into the numbers, what are pre-existing patients and what are new converted leads."
"Cross-reference their number that's calling in against their first appointment date in Simple Practice. If they already have a first appointment date — last month or 3 years prior — we know that number is just a patient calling in."
- Only tools: SimplePractice + CallTrackingMetrics
- Zero manual tagging by front-desk staff (Justin explicit)
- Automated extraction + cross-reference
- Deadline: Thu Oct 1, 1:30 PM ET meeting
Success = Justin can answer these 4 questions on Oct 1Using the dashboard, on his own, no explanation needed.▾
- 1. How many calls did I get last week? How many were existing patients vs new-patient inquiries?
- 2. Of the new-patient inquiries, how many booked a first appointment?
- 3. How much did each marketing channel (Google Ads, SEO, Meta, direct/GBP) cost me per new patient booked?
- 4. Which specific landing pages or campaigns are driving the most booked patients?
ArchitectureEvent-driven, cloud-only. Nothing runs on Justin's or the front-desk's computer.▾
Website (GTM)
├── Google Ads native number-swap (paid-search) + per-source subdomain LP tracked numbers (main funnel)
└── GA4 (G-Z5G9RXCB62) + Gravity Forms conversion trigger
│ │
▼ inbound call ▼ session + form
CTM webhook GA4 Data API
│ │
└────────┬─────────────────┘
▼
VHOS on VPS 144.202.33.136
Next.js 14 + Prisma + Postgres
/api/ingest/ctm /api/ingest/sp-export
/dashboard (live)
▲
│ SP scheduled export → Mailgun inbound
│
SimplePractice (Deepak has login)
Scheduled Reports: Clients + AppointmentsFOR every CTM call event:
IF caller_phone NOT IN opp_patients:
→ NEW_PATIENT_INQUIRY (attribute to source)
IF caller_phone IN opp_patients:
IF first_appt_date < call_date → EXISTING (noise, exclude)
IF first_appt_date ≥ call_date → NEW_CONVERTED (attribute)D-01DeepakBLOCKING0.1hPick a path so Mason can read SP 'export ready' emails from contact@allgoodseo.com▾
D-02Deepak0.25h← M-04Configure scheduled Clients + Appointments exports to VHOS ingest email▾
D-03Deepak0.5h← post Oct 15POST-PILOT: rotate to dedicated 'VHOS Integration' service user▾
D-04Deepak0h[OBSOLETE 2026-09-29] Deploy CTM DNI — Google Ads has native number-swap; subdomain LPs carry other attribution▾
D-05Deepak0h[OBSOLETE 2026-09-29] Create 4 CTM number pools — Google Ads swap + subdomain per-LP tracked numbers replace this▾
D-06Deepak0.5h← D-05Toggle CTM → GA4 native integration ON▾
D-07Deepak0.5hAdd Gravity Forms → GA4 conversion event trigger in GTM▾
D-08Deepak0hAccess matrix — CONFIRMED (Anthony 2026-09-24 3:45 PM): Deepak has all needed access▾
M-01Mason1hPostgres schema: opp_patients, opp_appointments, opp_calls_classified▾
M-02Mason2h← M-01CSV parser + E.164 phone normalizer▾
M-03Mason1hMailgun inbound domain ingest.verifiedhealthos.com → POST endpoint▾
M-19MasonBLOCKING0.5h← D-01Trigger SP test export using stored creds — capture 'export ready' email▾
M-04MasonBLOCKING0.5h← M-19Inspect captured email → decide Shape A / B / C download strategy▾
M-05Mason3h← M-04Build spDownloadFetcher + /api/ingest/sp-export route handler▾
M-06Mason1h← M-01, M-07Extend /api/ingest/ctm to write into opp_calls_classified + call matcher▾
M-07Mason2h← M-01Matcher engine: classifyCall(callerPhone, callDate)▾
M-08Mason1hGCP service account for GA4 Data API access▾
M-09Mason3h← M-08 + GA4 grantGA4 attribution puller: getSessionsByClientId()▾
M-10Mason3h← M-01, M-06, M-07Wire /dashboard to live Postgres (currently mock data)▾
M-11Mason1h← M-10Empty-state UI for pre-data window▾
M-12Mason4h← Google Ads accessGoogle Ads API: daily spend puller▾
M-13Mason3h← Meta BM accessMeta Marketing API: daily spend puller▾
M-14Mason1h← M-12, M-13Daily ad-spend cron on VPS▾
M-15Mason1h← M-03, M-05Monitoring: alert if SP email doesn't arrive in 24 hrs▾
M-16Mason3h← Everything aboveE2E test with 48 hrs of real data▾
M-17Mason1h← M-16Deploy + verify dashboard renders with real data▾
M-18Mason2h← M-17Polish + edge cases + monitoring dashboard▾
A-01AnthonyBLOCKING0.25hApprove this PRD + green-light spend for extra SP seat if needed▾
A-02AnthonyBLOCKING0.05h← A-01Send Deepak the PRD URL — flag D-01 as the blocker▾
A-03Anthony0.25h← A-01Send Justin the 'heads up, no action needed yet' message▾
A-04Anthony0.1hConfirm demo target: Thu Oct 1, 1:30 PM ET▾
A-05Anthony0.1hApprove any downstream infrastructure spend (Mailgun / fallback tools)▾
M-20Mason3hBuild /api/ingest/gravity-form endpoint + opp_form_fills schema▾
D-13Deepak0.5h← M-20Configure Gravity Forms Webhooks add-on on OPP forms 1 (site-wide) + 9 (/book-an-appointment/)▾
D-09Cristian0.25hGrant Mason access to OPP's Google Ads account (Anthony + Cristian)▾
D-10Cristian0.25hAdd Mason as analyst on OPP's Meta Business Manager (Anthony + Cristian)▾
D-11Cristian0.25h← M-08Grant GA4 service account Viewer access on property G-Z5G9RXCB62 (Anthony + Cristian)▾
D-12DeepakBLOCKING0.5hConfigure webhook on OPP's OWN CTM account (not 363409 / SHC) to POST to VHOS▾
J-04Justin0.5hAttend Oct 1 1:30 PM demo + validate numbers▾
Day-by-day timelineToday → demo Thu Oct 1▾
| Day | What happens |
|---|---|
| Thu Sep 24 (today) | PRD v1.2 shipped. Deepak picks a path for D-01 (email routing so Mason sees SP notifications). Mason has SP creds stored securely. |
| Fri Sep 25 AM | Deepak completes D-01 (path A/B/C). Mason triggers SP test export using stored creds (M-19), reads the 'ready' email via himalaya, inspects link → decides Shape (M-04). |
| Fri Sep 25 | Mason ships M-01, M-02, M-03, M-05, M-07, M-08, M-10 (~10h). Deepak works D-09, D-10, D-11 (ad-platform access grants for Mason) in parallel. |
| Sat Sep 26 | Mason completes M-06, M-09, M-11. Deepak starts D-02. |
| Sun Sep 27 | SP ingest live. GA4 puller (M-09). Deepak finishes D-06, D-07. Ad-spend APIs start (M-12, M-13). |
| Mon Sep 29 | E2E test with real 24-hr data (M-16). Fix issues. First real numbers on dashboard. |
| Tue Sep 30 | Polish + ad-spend cron (M-14) + alerting (M-15). |
| Wed Oct 1 AM | Final dry-run. Anthony reviews dashboard. |
| Thu Oct 1, 1:30 PM ET | 🎯 Live demo with real OPP data. |
Risks + mitigations9 named risks worth knowing before Thursday▾
| Risk | P | I | Mitigation |
|---|---|---|---|
| SP download link is Shape B/C (auth needed) | Med | Low | Playwright login well-understood; +4h build |
| SP CSV missing first_appointment_date | Med | Low | Deepak scheduling both reports covers this |
| Deepak lacks Google Ads / Meta admin | Med | Med | Ad spend manually entered for demo; automate wk 2 |
| GTM edits break existing tracking | Low | High | Test in GTM Preview + GA DebugView before publishing |
| SP UI changes → Playwright breaks | Low (pilot) | Med | Alert catches within 24h; ~30 min fix |
| Phone match rate low (many callers not in SP) | Med | Low | That's the correct behavior — they're new inquiries |
| Justin's estimates wildly off (300/wk, 80% existing) | High | Low | Dashboard shows real numbers; narrative adjusts |
| First 3 days data sparse | Certain | Low | Empty-state UI (M-11); demo uses 'as of yesterday' |
| HIPAA concerns (PHI over Mailgun) | Med | Med | Sign Mailgun BAA before go-live; encrypt at rest |
Reference docs + linksEvery external system referenced in this PRD▾
Verified this sessionFacts Mason confirmed via live tool calls, not memory▾
OPP website (curl of orlandopremierpsychiatry.com): GA4 property G-Z5G9RXCB62, GTM container GTM-W7VGDGLP, Gravity Forms IDs 1 (site-wide) and 9 (/book-an-appointment/), static phone (407) 565-3546. CTM DNI intentionally NOT deployed per 2026-09-29 architecture — Google Ads native swap + per-source subdomain LP tracked numbers replace it.
VHOS state (SSH + curl): VPS 144.202.33.136 uptime 9d, PM2 vhos-app online, /dashboard returns HTTP 200 in ~200ms.
SP scheduled reports (SP support docs): Delivery is a LINK not an attachment. Email subject "Your export is ready to download". Link expires ~24-36 hrs. Available formats: CSV or XLSX.
HIPAA session enforcement (Compliancy Group + AccountableHQ): §164.312(a)(2)(iii) auto-logoff. EHR best practice 10-15 min inactivity — session cookies do NOT persist for months.
SP credentials (received 2026-09-24 15:07 from Anthony): Account email contact@allgoodseo.com, no 2FA. Stored on VPS at /opt/vhos-app/secrets/opp-sp-creds.env · dir 700 · file 600 · root-only. Never committed, never echoed.
Mail access (himalaya IMAP test): anthony@allgoodseo.com fully readable via himalaya envelope list --account allgoodseo. contact@allgoodseo.com is a separate mailbox — reachable only after Deepak completes D-01 (picks one of the three routing paths: auto-forward, app password, or SP-side email change).
Housekeeping owed: (1) Anthony deletes the Telegram message with the plaintext SP creds. (2) Post-pilot, rotate to dedicated service user (task D-03).