Refficks

Lovable affiliate tracking with Refficks

Stripe checkouts in an app Lovable builds for you, credited to the partner whose link brought the buyer. Two prompts to paste.

Nobody has walked these steps against a real Lovable setup yet. They are built from the provider's documentation, listed at the bottom of this page.

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

  • Payments through Lovable's built-in checkout are not seen until you have claimed its Stripe account and connected it to Refficks.
  • 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

These are the steps as they read inside Refficks. Where one says “below”, it means this guide's page in Refficks, where your own script, addresses and checks are.

  1. 1. Take payments on your own Stripe account

    Use Lovable's Stripe integration with your own Stripe account. If you started with Lovable's built-in payments, claim the Stripe account they run on first: until then it is Lovable's, and no payment on it reaches Refficks.

    Connect the same Stripe account to Refficks, so its payments reach Refficks.

  2. 2. Ask Lovable to add the script

    Paste this into Lovable'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."

    Your copy of the Refficks script, with your own key in it, is on the Integrations page in Refficks.

  3. 3. Ask Lovable 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. 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.

More in Built with AI