Fastify
Tracks signups and sales from a Fastify backend, including sales from your own Stripe webhook.
What it does
- A script tag on your frontend stores the click in a first-party cookie.
- Your server sends each lead and each sale, with your own user ID.
- Your own Stripe webhook route gets the raw body, so Stripe’s signature check passes.
- With Stripe connected to Affitor, don’t call
trackSalethere: Affitor records the sales itself.
Set up in three steps
- Add the Affitor script tag to your frontend, and send the click ID with your signup form.
- Call
trackLeadwhen you create the user, and add Affitor metadata to the Checkout Session. - Give the Stripe webhook route a raw-body parser, then call
trackSalefrom it.