Skip to main content

Stripe Checkout (client-side) Integration

Integrate Rewardful with Stripe's client-side checkout

Written by Emmet Gibney

Integrating Rewardful is a quick way to set up affiliate and referral programs for Stripe's client-side checkout. We automatically track referred Visitors, Leads and Conversions from your affiliates, customers, influencers and/or partners. Commissions are automatically adjusted for any billing event changes such as downgrades, upgrades, free trials, cancellations and refunds.

Each person that signs up to your program will receive a personalized dashboard where they can create and manage their affiliate links, stats and track their success.

To set up the integration:

Then follow these steps to complete the integration:

I. Adding the Rewardful Tracking Script

Grab your Rewardful script from STEP 1 on the JavaScript integration page (Note: you don't need to add Step 2 as another code will handle the referral UUID).

Note: For users using Google Tag Manager in their WordPress site, grab this version of the STEP 1 script.

Paste the STEP 1 script in section where you're allowed to add custom head codes or if you're using a third-party plugin for handling custom head codes, paste it into that section.

II. Passing the referral ID to Stripe

The secton I script is the Rewardful tracking scriptl; this script creates a tracking cookie in the browser of the customer when it detects that the visit is coming from an affiliate link.

This referral ID needs to be retrieved using our tracking script's method (Javascript method) Rewardful.referral and then passed as to Stripe as clientReferenceId parameter of the stripe.redirectToCheckout() call.

Here is an example code (Javascript) on how to add the referral ID:

var checkoutParams = {
lineItems: [{ price: price, quantity: 1 }],
mode: mode,
successUrl: 'https://www.example.com/checkout?result=success',
cancelUrl: 'https://www.example.com/checkout/?result=cancel'
}

if (window.Rewardful && window.Rewardful.referral) {
checkoutParams.clientReferenceId = window.Rewardful.referral;
}

stripe.redirectToCheckout(checkoutParams);

IV. Confirming the Rewardful dashboard initial setup

  • Go back to your Rewardful dashboard, 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.

V. Referrals are not tracking? Check the following (Troubleshooting)

Make sure that:

  • The Rewardful tracking script is installed as described in this article.

  • The Stripe Payment Link has “Save Payment Details for Future Use” enabled.

  • The custom script was added under Footer Tracking (not Header).

  • You tested using an incognito window.

  • If you still see the issue, reach out to our support team, and we’ll be happy to take a look.

Did this answer your question?