Affiliate Programs recommendations

Does anyone use Affiliate Programs that integrate well with Bubble they can recommend? Or has anyone had any experience setting up an affiliate program in Bubble itself?

1 Like

Here is what I would do, assuming your user sign up flow includes sending a verification email. If it does not then cookie is not needed.

Create a user field type: text. On sign up calculate formula -> 7 or so digits with anything but special char. The field could be named refID or something that rhymes with that.

Create a db table ‘referral’ with refID and whatever else is appropriate; IP:text, hitLandingPage:bool, hitCheckoutPage:bool, etc

On you landing page(s) get data from url looking for that param. If it is not empty create a new referral entry and run JS -> cookies.set with the refID.

On the final checkout / conversion / action / whatever page makes the affiliate win the prize - cookies.get and have a WF run if not empty.

Now, you can have a referral page or view that says something like “Here is your affiliate link” and in an input form display https://somethingawesome.com/?current user:refID that the user can click to copy or email to themselves, etc.

6 Likes

this Canadian startup integrates with Stripe


haven’t used them but they’ve been recommended to me

1 Like

@elledarrow thanks for this, can you paste the JS code for cookies.set and cookies.get ?

Get the JS toolbox plugin if you don’t have it already. (https://bubble.io/plugin/toolbox-1488796042609x768734193128308700)

Go to the workflow tab -> When page is loaded.

Create the new ref entry as mentioned in first post.

On the page you want to set or get cookies create an HTML element 1 pixel x 1 pixel. Load JS Cookie by putting this in that element:

< script src=“https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.0/js.cookie.min.js”> (take notice there is a space that should be removed between the first < and the word script - when I originally posted Discourse did not display the entire line - I guess it was thought I was trying to run it)

Create a step ‘Run javascript’ - once the plugin is installed you’ll find it on the plugin section when creating a new step.

Assuming you are using ‘refID’ as the var, in the JS box put:

Cookies.set(‘refID’,‘Get refID from page URL’,{expires: 60});

The Get refID from page URL should show blue since it is dynamic data.

In this example the cookie expires in 60 days.

On your checkout page, in the editor visual elements locate “Javascript to Bubble”. Drag that onto your page 1 pix X 1 pix

Assuming you enter ‘c’ (without quotes) - in bubble_fn_suffix make certain ‘publish value’ is checked, value type text.

Drag an input element onto the page 1x1 pix. In the intital content -> dynamic data JavascripttoBubble A’s value

On page load (your checkout page) in workflow add a Run javascript. In the box put:

var value = Cookies.get(‘refID’);
bubble_fn_c(value);

Test it by loading your url : somethingAmazing.com/?refID=abcd

In Firefox click the Tools -> Web Developer -> Storage inspector. You should see the cookie you just set.

On your checkout page read the cookie and take action if not empty.

4 Likes

Thank you @elledarrow, this is more than I asked for. Cheers.

@jagdish_bajaj You are quite welcome. I hope it works out… keep me posted?

1 Like

Great, big thanks