Bolt affiliate tracking with Refficks
Stripe checkouts in an app Bolt builds for you, credited to the partner whose link brought the buyer. Two prompts to paste.
What it gives you
- A payment through a Checkout Session your app opens is credited to the partner whose link brought the buyer, straight from the payment in your Stripe account.
- A subscription keeps its partner for every renewal, a refund takes the commission back by itself, and partners' codes synced to Stripe work at the checkout as they are.
What it does not
- An AI builder writes the code from these words, and may write it differently from one app to the next. The checks say whether it worked. If the visitor check stays amber after a test purchase through a partner's link, paste the second prompt again, or read the checkout code if your plan lets you.
- A visitor who has not accepted cookies, or whose browser sends Global Privacy Control, has no visitor id to pass on. Their sale can still be credited through the partner's discount code.
- Only Checkout Sessions on a Stripe account connected to Refficks are seen. Payments taken some other way need their own guide.
Steps
1. Take payments on your own Stripe account
Add Stripe through Bolt's Stripe integration with your own Stripe account. Bolt creates each checkout in a Supabase function, which is where the second prompt makes its change.
Connect the same Stripe account to Refficks, so its payments reach Refficks.
2. Ask Bolt to add the script
Paste this into Bolt's chat, followed by the snippet below: "Add this script tag to the head of every page of the app, exactly as written, before any other script."
3. Ask Bolt to pass the visitor to Stripe
Paste the prompt below into the chat as it is. It asks for the visitor the script saw arrive to be sent with every checkout, and changes nothing else.
When the app creates a Stripe Checkout Session, pass on the visitor the Refficks script saw arrive. Change nothing else about the checkout. 1. In the browser, just before asking for a checkout, read the visitor id: window.refficks ? window.refficks.visitorId() : null It is often null, and that is fine. 2. Send it with the request that creates the Checkout Session, as a field named refficks_visitor. 3. Where the session is created, if refficks_visitor is exactly 26 letters and digits, add metadata: { refficks_visitor: refficks_visitor } and, when the mode is "subscription", also subscription_data: { metadata: { refficks_visitor: refficks_visitor } } If it is missing or anything else, leave both out. 4. Do this everywhere the app creates a Checkout Session.4. Make a test purchase
Open your site through any partner's link, copied from their page under Partners, and buy something with Stripe in test mode. The checks on this guide in Refficks turn green as each part is seen. A test payment is never counted as a sale.
Sources
Have an account? Open this guide in Refficks for your own script and the checks that show when it is working. New to Refficks? Create an account.