Integrating Stripe with Refersion requires some technical knowhow, if you are unsure about any of the steps we suggest you consult with your web developer to complete the integration. If you have any questions, feel free to shoot us an email and we'd be glad to help! 

Below are the required steps to connecting Refersion to Stripe:

  1. Connect: Connect your Refersion account to Stripe so that we can receive order information (via webhook) from Stripe
  2. Install Tracking: Install Refersion's tracking script on your site, ideally in the head of any page a user can land. This usually means all marketing/content pages except for the checkout and thank you pages
  3. Tracking orders: Report each `stripe_customer_id' or 'order_id' to us on your Thank You Page

Step 1 - Connecting your Refersion account to Stripe

If you have just signed up to Refersion, choose Stripe from the Start Guide. If you've already signed up, go to Account > Settings > Tracking and click on Add Tracking. Click Stripe

Enter your shop's URL including the http/https as relevant, check the installation box, and click Connect with Stripe

Click Sign in with Stripe to connect and follow the instructions.

Step 2 ‐ Install Refersion's Tracking Script

Install Refersion's tracking script anywhere a user can land, this is typically installed in the header or footer your site. Replace both SUBDOMAIN and PUB_KEY below with the Refersion Subdomain and Public Key from the Tracking Page (be sure you are signed in to Refersion to have the relevant info populated!).

<!‐‐ REFERSION TRACKING: BEGIN ‐‐>
<script src="//SUBDOMAIN.refersion.com/tracker/v3/PUB_KEY.js"></script>
<script>_refersion();</script>
<!‐‐ REFERSION TRACKING: END ‐‐>

To test that this has been installed on a certain page, follow the first few steps in Perform a Test Order. If you see the Success! Your Refersion click was tracked pop-up that means the script is successfully installed.

Step 3 ‐ Tracking Orders

This is the last step, alerting Refersion that a new order has been placed. The customer_id/order_id is the connector that links the order to the affiliate, identifying that an order was placed that is linked to an affiliate click. Refersion then matches the order ID to the order information received via webhook and calculates the commission due to the affiliate.

Simply copy and paste the following code on your Thank You/Confirmation Page. Replace both SUBDOMAIN and PUB_KEY with the Refersion Subdomain and Public Key from the Tracking Page (be sure you are signed in to Refersion to have the appropriate PUB_KEY populated, or go here for instructions on how to find them) And replace “ORDER_ID” (without the quotes) with either the Stripe customer_id or order_id (if you’re using Stripe Relay).

<!‐‐ REFERSION TRACKING: BEGIN ‐‐>
<script src="//SUBDOMAIN.refersion.com/tracker/v3/PUB_KEY.js"></script>
<script>_refersion(function(){ _rfsn._setSource("STRIPE"); _rfsn._addCart("STRIPE-CUSTOMER-ID"); });</script>
<!‐‐ REFERSION TRACKING: END ‐‐>

IMPORTANT: In order for tracking to work, the pages where the click tracking code is installed in Step 2 must be on the same domain and security level as the Thank You/Confirmation Page (http/https).

Run a test order to make sure everything is tracking properly (note that trial subscriptions will not be tracked until a payment is made). If you have any questions, shoot us an email!

Did this answer your question?