Refersion helps you build a custom affiliate referral program. You can use Refersion to create affiliate programs, add affiliates and record their bonuses.
Chargebee-Refersion integration enables you to track and report the purchases that are generated by your affiliates.
The report on the aforementioned purchases can be found in your Refersion Account.
If you are an API user, contact support@chargebee.com to set up order tracking for your site via the API.
You need to configure credentials in both Chargebee and Refersion before you get started.
It goes both ways- Chargebee's should be configured in Refersion and vice versa.
Configure Chargebee's Credentials in Refersion
If you are new to Refersion, sign up for a Refersion account. As a part of the signup process, you will be prompted to connect with the platforms you are using with your website, select Chargebee from the list.
If you already have a Refersion account, log in and navigate to Account > Settings > Tracking and click the Add Tracking option. Select Chargebee from the list of platforms displayed.
Now you will be prompted with a page, where you can need to enter the details of your business:
Copy the details under API Keys and Subdomain, as they come in handy in the upcoming step(when you add Refersion's credentials in Chargebee).
Configure Refersion's Credentials in Chargebee
Log in to your Chargebee site and navigate to Settings > Third Party Integrations > Refersion
Fill in the following details of your Refersion account:
Refersion API keys (Public and Secret): You can find this information in Refersion by navigating to Account > Settings > Refersion API
Or you can find these details from the prompt that appeared in your Refersion account while you were setting up Chargebee in Refersion. Click here to know more on how to find the keys in Refersion.
Subdomain: Subdomain refers to the name of your Refersion shop as it appears in your Refersion URL (example: acme.refersion.com)
Version: If you are new user or have started using Refersion, select v2 from the dropdown menu.
Refersion is equipped to track visits and orders in your website that occur as a direct result of your affiliates. Insert this snippet of JS code into the webpages (on your website) that you would like Refersion to keep a track of for affiliate redirected visits.
Chargebee can send the order data back to Refersion using Webhooks.
To configure Refersion's webhook in your Chargebee site, sign in to your Chargebee site and navigate to Settings > Configure Chargebee > Webhooks and click Add new webhook.
Here Webhook URL needs to be focused on. Replace SUBDOMAIN, PUB_KEY and SEC_KEY in the URL mentioned below with Refersion's Subdomain, Public Key and Secret Key, and the rest can stay as is.
https://SUBDOMAIN.refersion.com/tracker/chargebee/conversion/v2/?public_key=PUB_KEY&private_key=SEC_KEY
For details on the rest of the webhook settings, refer Webhook Settings page.
If you're using your own Thank You page, you need to add Refersion's URL parameter to your redirect URL. For that, log in to your Chargebee site and navigate to Product Catalog > Plans and select the plan your affiliate is referring you for and Edit the plan.
Find the section Hosted Page & Customer Portal and add the snippet ?rfsn_ci=#{{subscription.id}} to the configured Thank you page
Add the following code snippet from Refersion in your Thank you page for Refersion's tracking.
Replace SUBDOMAIN and pub_key in the snippet with Refersion's Subdomain and Public Key, without changing the rest of the code.
Click here to know how to find Refersion's Subdomain and Public Key.
*<!-- REFERSION TRACKING: BEGIN -->* <script src="//SUBDOMAIN.refersion.com/tracker/v3/pub_key.js"> </script><script>**function** **rfsn_getQS**(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");**var** t=**new** RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(location.search);**return** n==null?"":decodeURIComponent(n[1].replace(/\+/g," "))} **if** (rfsn_getQS('rfsn_ci')) { _refersion(**function**(){ _rfsn._addCart(rfsn_getQS('rfsn_ci')); _rfsn._setSource("CHARGEBEE"); });�}</script> *<!-- REFERSION TRACKING: END —>*
After setting up your campaign in Refersion, for every transaction made through your affiliate, you can find a report on the purchase in your Refersion Account. Learn more about how Refersion handles payments to affiliates.
Chargebee-Refersion Integration will not function if Consolidated Invoicing is enabled in your Chargebee site.
1. What does Refersion track on my website?
Refersion tracks and reports on two things:
2. Chargebee communicates with Refersion via webhook. Where can I find this webhook on my Refersion site?
The webhook that Chargebee uses to communicate with Refersion needs to be set up manually using your Refersion subdomain, your public API key and your secret API key. It cannot be copied from your Refersion website and pasted in Chargebee.
3. Where can I find my API keys in Refersion?
Your API keys are available at: Account > Settings > Refersion API. Log in to your Refersion account and navigate to this page to access your API keys.
4. How do I know what version of Refersion to choose in Chargebee?
If you are a new user or are using the Chargebee-Refersion integration for the first time, then choose version two.