Refficks

Supabase affiliate tracking with Refficks

New accounts in your app's Supabase sign-up, tied to the partner whose link brought them, so their later payment is credited to that partner.

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

What it gives you

  • Somebody who arrives through a partner's link and then creates an account in your app is tied to that partner. When they later pay, through any payment connection Refficks receives, the sale is credited to the partner who sent them.
  • A referral programme that rewards "they create an account" counts it.

What it does not

  • Accounts made with a sign-in button (Google, GitHub and the like) are not named: Supabase does not tell the page which of those sign-ins are new.
  • Only new accounts are named, never every sign-in: somebody who signed up before following a partner's link would otherwise read as an account that partner brought.
  • A partner is paid when that person pays, and the payment has to reach Refficks from a connection that names the same email.
  • A visitor who has not accepted cookies, or whose browser sends Global Privacy Control, is not named.

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. Put the Refficks script on every page

    Paste the snippet into the head of every page of your app, in its main layout. It records the partner's click when somebody arrives.

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

  2. 2. Name them where your app signs them up

    Where your sign-up form calls supabase.auth.signUp(), add the lines after it as below. They name the person only when Supabase made a new account: an address that already has one comes back without an identity, and is left alone.

    // Where your sign-up form calls Supabase:
    const { data, error } = await supabase.auth.signUp({ email, password });
    
    // A new account has an identity; an address already signed up has none.
    if (!error && data.user && data.user.identities && data.user.identities.length > 0) {
      (function say(tries) {
        if (!window.refficks) return tries < 40 && setTimeout(() => say(tries + 1), 250);
        window.refficks.identify({ email: data.user.email, external_id: data.user.id });
      })(0);
    }
  3. 3. Try it

    Open your app through any partner's link, copied from their page under Partners, and create an account. The checks on this guide in Refficks say when the new account was named, and when a sale is credited once that person pays.

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 Your sign-in