What’s the best way to add an affiliate / referral program into Weweb apps?

How do we run affiliate programs / referral programs on apps with Weweb? Is there a recommended app / software? :smiley:

1 Like

You write to your database based on a query string parameter, nothing fancy really. What functionalities is this refferral supposed to have?

How will we integrate this with Stripe so that the affiliates get a commission for every friend they recommended?

You would count this on backend and then do one time payout based on the database by multiplying it by some logic.

Sorry I don’t quite understand. What do you mean by that?

  1. You store the relationships between who invited who via a magic link, by saving the relationships to Xano/Supabase. You can do this by looking at query parameter.
  2. You set a dashboard, where people can withdraw, it’s not done automatically, that would be too much hassle for nothing. People indeed are motivated to withdraw, so they won’t mind.
  3. When they want to withdraw, you do your magic, either send them money, or something, via your prefferred method. Tax wise I’m not sure where this falls, depends on your country.

If you don’t have particular functionality where you need to do this from scratch, I recommend using an off-the-shelf tool like Growsurf.

However, we’ve developed a referral functionality for a client that needed something more bespoke, following similar logic to what @Broberto mentioned. Then, we used an integration with Tremendous to handle global payouts.

Ah, I see. This has been very insightful @caffeinatedwes and @Broberto — there’s 2 things I don’t get:

I’m wondering how do we track clicks?

Also, affiliate links usually have a cookie period - how would we implement this?

Thank you both.

Define a click for us please :slight_smile: You mean how you track users landing on your site?

@Broberto Yes! Usually affiliate programs have a dashboard where affiliates can see how many visitors they are driving via their affiliate links. :blush:

You append to each link a query string and then work with that

Are you talking about the clicks or the cookie period? Not quite understanding :frowning:

When you create the affiliate links, you append a query string which will help you identify the user. When the user clicks on the link, it brings him to your page, where you look for the query string, if it exists, you write to your database the relationship, based on the identifier you get from the url string

  1. Is there a way to track how many visitors visited the link with the ref code? Regardless of whether it’s saved to the database or not. Because some people won’t sign up…

  2. What if the referred visitor goes to my sign up page with the ref link, but does not sign up, but later comes back and signs up?

  1. You can make a table for that solely, for analytics, and write to both referral, and also visited referral.
  2. You could store it as a cookie or something similar and then on signup check for it, or just make people insert the code. Depends on how you want to deliver it.

Ah, I see… does this mean that for every visitor to the ref url, I create an additional row in that database table?

Also, how do I store as a cookie?

I think you’ll be fine with localStorage, even though having ability to set a cookie - without custom JavaScript would be cool @aurelie?

@Broberto Hello! I’m trying to do what you suggested above but am running into a slight roadblock — let’s say someone goes to url.com/ref=RAELYN3847

So the refID is “RAELYN3847”.

How do I store this in a variable, for starters?

Would it be via a “on page load” workflow? & if so, how would I do it? I can’t find the refID in the editor…?

I have created a refID query variable -

Trying to change its value on page load but can’t seem to find a value for it to be changed to?

Am i on the right track? How do I change refID to what’s in the URL?

  1. create the variable, in my case it’s ref
  2. append ?ref=Raelyn to your URL as shown in the screenshot and reload the page (not only the editor - hard refresh the page)
  3. Done

You in theory can check for refs on each page via a saved global workflow, if you wanted to do it like you did with a slug /ref=RAELYN, I’m not sure how that would work, you 'd have to create a dynamic page for that.

So yeah, I’m also sending some a very nice documentation on the query strings and the URLs in general, as I feel like it might be confusing at first.

After that, you can store it however you want it, as I mentioned, you could do a global workflow and call it each time page loads to check if it’s in the string and against your backend.