Handoff

Goal

Use Airtable as the source of truth for pharmacy landing pages and attribute Calendly welcome-call bookings back to the referring pharmacy, then write those bookings into the consolidated Airtable Patients table.

Current State

Airtable-driven partner pages

Local and Netlify env handling

Partner landing page CTA behavior

Attribution logic

Implemented in js/app.js.

Current precedence for Calendly attribution:

  1. If the page URL already contains utm_source=pharmacy and utm_content, use that utm_content.
  2. Otherwise, on a partner page use Airtable QR batch code.
  3. If QR batch code is missing, fall back to the partner slug.

Partner CTA markup now includes:

This is deliberate because:

Those are not always identical in Airtable.

Calendly event tracking already in browser

Existing browser listener in js/app.js:

That listener now also includes utmSource and utmContent in the Rudder event when available.

Netlify webhook receiver

Added:

Configured in:

Function endpoint:

What it does:

Default lead behavior:

BP patient import

Files Changed

Environment Variables

Already used for Airtable partner-page builds

Needed for the Calendly webhook flow

Optional overrides if Airtable field names differ

Optional overrides for BP CSV imports

What Has Been Verified

What Has Not Been Verified Yet

Next Steps

1. Finish homepage / UTM verification

Book a welcome call from:

Then verify in Airtable Patients:

2. Move the webhook from preview to production

Current temporary webhook target:

Production target should become:

Practical options:

Reason to leave preview in place temporarily:

3. Optional signature verification

If you want signed webhook verification in production:

Until then, leaving that env var unset keeps the current unsigned webhook behavior.

4. Recommended hardening

Recommended next improvements after webhook testing:

This will give clean dedupe on repeated webhook deliveries or reschedules.

5. Resolve BP import exceptions

The safe BP import intentionally skipped uncertain rows. Use the exception lists from:

npm run patients:sync-bp

Current unresolved buckets after the BPS Search Result 2026052750508.csv import:

Work through these manually using the process in scripts/README.md:

Open Questions

Decided:

Useful URLs