Docs
Refersion is an affiliate marketing platform that connects to your e-commerce store and manages every aspect of your program in one place. It helps online shops track sales driven by promoters, influencers, and affiliates. Easier to create, grow, and track your very own affiliate program. Getting set up takes minutes and requires zero technical knowledge.
You can use Refersion to:
The 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 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.
If you already have a Refersion account, follow these steps to set up an integration 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 along with your website.
Select Chargebee from the platform options listed here.
Configure Refersion's Credentials in Chargebee:
Enter the following information:
Chargebee Thank You Page: This field displays two options in the dropdown as listed here:
Refer to Chargebee's Integrations Options for further details on configuring credentials.
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).
Follow these steps to set up the integration from Refersion to Chargebee within the Chargebee store:
Now that you have set up the integration in Refersion log into the Chargebee site to connect to the created Refersion account.
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.
https://<SUBDOMAIN>.refersion.com/tracker/chargebee/conversion/v2/?public_key=<PUB_KEY>&private_key=<SEC_KEY>
Add Chargebee JS to your header.
If you are using, Chargebee's Drop-In Script to generate the Subscribe button,
Note:Add the parameter data-cb-refersion-enabled="true" to your Chargebee JS function in the header.
If you are using, Chargebee JS and generating your own Subscribe buttons, Add the following script in all the pages that have the checkout/subscribe button.
<!-- REFERSION TRACKING: BEGIN -->
<script>
! function(e, n, t, i, o, c, s, a) {
e.TrackingSystemObject = "r", (s = n.createElement(t)).async = 1, s.src = "https://cdn.refersion.com/refersion.js", s.onload = function() {
r.pubKey = "<PUB_KEY>";
// Uncomment next line if you need to debug during testing
// r.settings.dbg_mode = true;
r.settings.fp_off = true;
r.initializeXDLS().then(() => {
r.launchDefault().then(() => {
const rfsnTrackingEvent = new Event("refersion-loaded");
document.dispatchEvent(rfsnTrackingEvent);
});
});
}, (a = n.getElementsByTagName(t)[0]).parentNode.insertBefore(s, a);
}(window, document, "script");
</script>
<!-- REFERSION TRACKING: END -->
/* Note to Add the Public Key to the code */
Chargebee's default Thank you page
Custom Thank you page
You can also choose to redirect users to a custom Thank you page designed by you. Chargebee supports this out of the box. To enable this and then track the conversion on Refersion,
Navigate to plans, select the plan, and add the Redirect URL.
To the configured Redirect URL / Thank you page, add ?rfsn_ci={{Find Domain Here }}.
If your Thank you page's URL was,
https://acmeinc.com/success.html
This would be,
**https://acmeinc.com/success.html*?rfsn_ci={{subscription.id}}**
<!-- REFERSION TRACKING: BEGIN -->
<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, " "));
}
document.addEventListener("refersion-loaded", function() {
const cart = rfsn_getQS('rfsn_ci');
let id = '', aid = '', cs = '', url = window.location.href;
try {
id = localStorage.getItem("rfsn_v4_id");
aid = localStorage.getItem("rfsn_v4_aid");
cs = localStorage.getItem("rfsn_v4_cs");
if (id && aid && cs) {
r.sendCheckoutEvent(cart, id, url, aid, cs);
} else {
console.warn("Missing Refersion parameters.");
}
} catch (error) {
console.error(error);
}
});
console.log(rfsn_getQS('rfsn_ci'));
</script>
<!-- REFERSION TRACKING: END -->
White list your domain in Chargebee.
This is applicable only when you are using Chargebee's Checkout.
Click Get Test Link, this will generate a unique test URL for you.
Copy the link, open a new incognito window, and paste the URL.
Test the Subscription purchase flow.
Post the purchase, the plan you just bought should reflect as a Conversion on Refersion against the test affiliate. You can see this in the Manage > Conversions section on Refersion.
1.What does Refersion track on my website?
Refersion tracks and reports on two things:
Visits to your website that are a direct result of your affiliates (these are tracked through the affiliate URLs that you set up in your Refersion site)
Orders made on your website (or with Chargebee's hosted pages) are a direct result of your affiliates.
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.