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 trackSale there: Affitor records the sales itself.

Set up in three steps

  1. Add the Affitor script tag to your frontend, and send the click ID with your signup form.
  2. Call trackLead when you create the user, and add Affitor metadata to the Checkout Session.
  3. Give the Stripe webhook route a raw-body parser, then call trackSale from it.

Read the full guide: Fastify guide

More integrations