Affiliate Marketing URL Program Help

Hi Bubblers,

I am looking to create an affiliate marketing program for my Bubble website. I want to add a page to my application.

I want my users to be able to generate affiliate marketing URL links for any eCommerce website. The URLs should correlate to my site and each user that generates the URL. I want to keep track of each user’s conversions in a dashboard viewable to them and me. I want to keep track of the total generated by all users.

Please email all ideas to adam.wollet@gazin.co

Thanks,
Adam

1 Like

You’re going to need a few things

A way to drop cookies (local storage plug-in)
Browser Cookies Plugin | Bubble

A random generated string or unique Id
that appends to the end of your URL I’d call this something like “ref” (gets saved to the profile of the user) you will use this as a URL param.

A data field inside user for long term tracking of who referred them. Referring user - data type = user

data type “cookies” (expire date, cookie value)

Data field inside your user for referrals (list of “cookies”)

A workflow for on page load when URL parameter “ref” is not empty and the cookie type you drop is not detected
(Action 1) Create a cookie on the visitors browser
(Action 2) Create new cookie (results from step 1)
(Action 3) Make changes to Do search for user ref = url parameter ref value.
Add cookie to list referral in that user

A workflow for on page load when and the cookie type you drop is detected
(Action 1) delete old cookie
(Action 2) drop new cookie
(Action 3) Create a new cookie
(Action 4) Same as action 3 in last workflow.
(This is to ensure your browser cookies don’t expire after 30 days or so like many browsers do)

Now for long term tracking of who referred and signup tracking.

In your signup flow
Only when cookie is not empty and do search for cookies (current cookie) is not empty and do search for cookies (current cookie) first item expiration date > current date and time.
(Action 1) make changes to current user : data type referring user = do search for users referrals list of referrals contains current cookie. (Save the referring user to the user that just signed up)

Now for purchases
Make a data type for referring purchases.

when current user referring user is not empty
(Action 1) normal payment flow.
(Action 2) Create new referring purchase (amount, date, affiliate commission %, buying user, referring user)
(Action 3) add referring purchase to a data type list in the referring user called list of referring purchases.
(Action 4) payout with stripe, PayPal, or whatever API your using.

6 Likes

Thank you Chris. It is much appreciated !

Hi Chris, how much would you charge to create this flow with the data and payment processing (receipt to my site and out to the referring affiliate)?
Your instructions were spot on but I don’t think I have time to add this myself right now as I’m still not a master Bubbler.
Thanks for your help and for adding to this topic.

Update:

For anyone having similar issues, I ended up figuring this out just after making my original post. As often seems to be the case when working with third-party plugins, the debugger can be misleading.

This was an issue of workflow actions not running synchronously, even when wrapped in a custom event, even though common wisdom suggests they should. The thing common wisdom neglects (and that I often forget) is that wrapping an action in a custom event, if this action relies on a third-party plugin, does not guarantee it will complete before subsequent steps run. The tricky bit is that this fact won’t be obvious when running in debug mode, since you’re slowing down execution.

The solution for me ended up being simple. I moved the “Read Local Storage” action out of the suspect workflow to my “page load” event to ensure the cookie’s value was actually readable before referencing it in the “sign the user up” step.

Hope this proves helpful to someone!

Original Post:

Hi there! Thanks so much for sharing all this. Very helpful. I’m hoping you might be able to help me troubleshoot an issue I’m running into when trying to implement something similar. It’s really got me stumped.

I’ve implemented a simple workflow using the “Local Storage & Cookies” plugin that drops a cookie containing the referring user’s unique id if the “ref” param is present and the current user is not logged in. On registration, I then check to see if this cookie is present and, if so, create a “referrer” record on the newly created user, pointing to the referring user.

Everything works as expected when dropping and updating the cookie. In debug mode, the registration flow seems to be working fine, as well. I can see the lookup of the referring user succeeding and the CRUD workflow to update the associated field on the new user looks to be working, as well.

The challenge is that, for some reason, this “referrer” record is not reflected in the database and, when I inspect my logs, I don’t see it there, either, even though I did see it being passed in debug mode. I’ve double checked my privacy settings and don’t see anything that could be causing issues there. I’m honestly totally stumped and wondering if you might see something I’m missing. Really appreciate any insights you can offer.