meta demo bookings audience sync
A daily sync that keeps a Meta custom audience aligned with people who booked demos through Meta ads.
tldr
A daily, idempotent Postgres-to-Meta pipeline that turns real demo bookings into a continuously maintained advertising audience.
the problem
A form fill is not the same as sales intent. Without a reliable sync, audience exclusions and retargeting lists drift away from the people who actually booked a demo, forcing the growth team into manual exports.
what it is
A daily sync that keeps a Meta custom audience aligned with people who booked demos through Meta ads.
why it is useful
It lets ad targeting and exclusion use actual demo intent instead of relying on manual exports or weak form-fill signals.
architecture
A disposable Railway cron container runs one Node script. It queries Postgres, deduplicates the latest booking per email, classifies messy source fields, hashes contact data with SHA-256, uploads batches to the Meta Marketing API, and records successful emails in a Postgres tracking table.
how it works
- The cron job loads bookings from the shared Postgres analytics table.
- It filters for Meta-sourced bookings and keeps the latest relevant booking per normalized email.
- Contact data is hashed with SHA-256 and sent to Meta in bounded batches.
- Successful records are written to a tracking table so later runs do not resend the same people.
implementation notes
- Filters Meta-sourced bookings from a shared analytics table.
- Uses a durable database table for idempotency instead of local filesystem state.
- Uploads up to 5,000 hashed records per batch.
- Creates its own tracking table and supports dry-run operation before sending data.
engineering decisions
- Uses database-backed idempotency instead of local files, because the worker is disposable.
- Supports dry-run execution before live audience updates.
- Treats inconsistent source labels as an input-normalization problem rather than relying on one exact string.