Skip to main content

Integration with AI-Generated Websites

How to integrate Rewardful with websites generated by Loveable or Base44

Charles Rosel avatar
Written by Charles Rosel
Updated this week

With the advent of AI, there are now SaaS platforms that allows you to generate full working websites through different prompts. Platforms such as Loveable or Base44 provides their customers the ability to create website by prompting their AIs.

Rewardful can be integrated with these AI-generated websites via the recommended prompts below:

I. Tracking script integration

Copy your Rewardful tracking script (STEP 1 script only, ignore STEP 2) from this page and give it to the AI once it asks for it.

Prompt to AI:

Add this script to the site's global head section.

Provide your tracking script to the AI when it requests for it.

Note: If your site is using React or NextJS frameworks in the frontend, have the AI refactor/modify the tracking script so that it will load properly in the frontend.

II. Stripe Checkout Integration

Loveable AI and Base44 AI usually generate Stripe checkout forms by using the Stripe Checkout Session method.

You will be using this instruction set as a guide to setup the integration with your Stripe checkout.

Here's a quick overview of the instruction set:

  • The STEP 1 script is the tracking script. You already implemented this on the previous section.

  • This tracking script produces a tracking cookie when it detects that the visit is coming from an affiliate link. This tracking cookie has an ID that can be retrieved via the STEP 1 script's method Rewardful.referral: https://developers.rewardful.com/javascript-api/overview#referral. This is STEP 2.

  • This referral ID or tracking ID needs to be passed to Stripe using the STEP 3 method, you will assign it to the parameter of the checkout session client_reference_id.

Prompt to AI:

When creating a checkout session, add a checkout session parameter called client_reference_id. The value of this parameter can be retrieved from a frontend cookie data via the Javascript method Rewardful.referral.

III. Confirming the Rewardful dashboard initial setup

  • Go to this page then click the Ok I've completed this button.

  • On the next set of instructions, open the link that has a ?via=install on an incognito window or private browser, let your site fully load.

  • Go back to your Rewardful dashboard and refresh the page. If the STEP 1 tracking script is correctly placed it will confirm your Rewardful initial dashboard setup.

  • If there's no confirmation, please chat with us or email us so that we'll check things for you.

IV. Testing the integration

Once setup has been confirmed, you can deploy it to production and then test using this guide:

TESTING NOTES:

  • STEP 6 is important as this will simulate a referred customer.

  • Use incognito/private browsing mode that doesn't have an adblocker. Or use a different browser wherein the cache and cookies are clean and there's no adblocker.

  • Also, use an email address that is not yet present on your Stripe Customer record section.

TESTING STEPS:

  1. Make sure you have finished the integration of Rewardful in your marketing website.

  2. If possible, create a trial period to simulate actual signup or purchase. If not possible, proceed with an actual charge, you may refund the charged amount later on.

  3. Create a test affiliate account.

  4. Once the affiliate is created, go to Affiliates > name of Affiliate > Links.

  5. Copy the affiliate link.

  6. Open up an incognito browser or a different browser with a clean cache and no adblocker extension.

  7. Paste the affiliate link on the browser you copied on STEP 5.

  8. Proceed with the checkout/signup flow.

  9. Once checkout/signup is complete, go to your Stripe account.

  10. Go to Customers > test email address of the test purchase.

  11. Check the Metadata section, check for the field labeled "referral" and the value is alphanumeric character. If not present, contact us for further support.

Note: If you're using Stripe Test Mode, instead of implementing STEP 10 and STEP 11, look for the checkout.session.completed webhook event. Check if the client_reference_id value is null or it contains the referral ID.

If your website generator used a different Stripe Checkout method, please contact support and inform us what method was used and we will provide additional guidance.

Did this answer your question?