Integrating Refersion with Chargebee

Modified on: Fri, 1 Mar, 2019 at 4:38 PM

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.


  1. If you are an API user, contact  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.

        *<!-- REFERSION TRACKING: BEGIN -->*
        <script src="//"></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.

        <script src=""
        data-cb-site="your-site" data-cb-refersion-enabled="true">

Joe is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.