The Chargebee-Refersion integration allows you to set up an affiliate referral program to help you track and reward your affiliates. The integration tracks your customers’ sign-ups and payments made through Chargebee via affiliate referrals.


Here’s an outline of the steps involved. For the complete steps for the integration refer to our help documentation. 


Step 1:

To set up the integration, navigate to Settings > Third Party Integrations > Refersion in your Chargebee account. Click here to know more on how to find the required keys in Refersion.

Step 2: Add Tracking Script

Insert this Refersion snippet of JS code into the web pages of your website that you would like Refersion to keep a track of.


Step 3: Configure Webhooks

To send the order data back to Refersion, configure Refersion's webhook in your Chargebee site under Settings > Configure Chargebee > Webhooks and click Add new webhook.



Note

  1. If you are an API user, contact support@chargebee.com  to set up order tracking for your site via the API.

  2. If you’re using the Chargebee JS, you’d also need to whitelist your domain in Chargebee. Go to Settings > Configure Chargebee > Checkout & Self Serve Portal > Advanced Settings > Add Domains and add your site. Add the following script in all the pages that have the checkout/subscribe button.


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


        Here, replace SUBDOMAIN and PUB_KEY in the snippet with Refersion's Subdomain and Public Key.


  1. If you are using the drop-in script, add the attribute data-cb-refersion-enabled="true" in the header script of the plans.

        Example:
        <script src="https://js.chargebee.com/v2/chargebee.js"
        data-cb-site="your-site" data-cb-refersion-enabled="true">