Docschargebeedocs

HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started Guide


  • Getting Started Guide

Managing Experiences


  • Getting to know the Experience Manager

Reporting


  • Reporting Overview

Chargebee Billing Integration


  • Chargebee Billing Integration Features

Settings and Installation


  • Navigating the Chargebee Retention Settings Page
    • Integrate Chargebee Retention via Chargebee.js
    • Installing Chargebee Retention via the pre-cancel API
    • Estimating Engineering Time & Effort
    • Processing Cancels and Offers
    • Configuring Cancel Management without a Billing Integration
    • Configuring Offer Management without a Billing Integration
    • Passing Data to Chargebee Retention
    • Chargebee Retention Field Mapping
    • Setting up a Custom Domain
    • Save and Cancel Return URL Setup
    • Activity Log and Error Reporting
    • Display Revenue in Reports
    • Using Webhooks
    • Manage Alerts
    • CSS Reference
    • Setting up multiple apps (Enterprise Plan)
    • Removing test sessions from reporting
    • External Reason Key
    • Billing Admin User Role
    • The Essentials Plan
    • Managing your Chargebee Retention Plan and Usage Limits
    • Adding Chargebee Retention to ReCharge's Affinity Theme
    • Managing your team in Chargebee Retention
    • Managing Teams to Control App Access

Integrations


  • Integrations Overview

Starter Churn Insights


  • Starter Churn Insights

Retention Best Practices


  • Testing in Chargebee Retention

Security


  • Chargebee Retention Security Overview
  1. Retention
  2. Settings and Installation
  3. Navigating the Chargebee Retention Settings Page
  4. Adding Chargebee Retention to ReCharge's Affinity Theme
Proactively retain, expand, and grow revenue with Chargebee Growth - the next evolution of Chargebee Retention.Built on top of Chargebee Billing, Growth empowers you to design, experiment, and deploy monetization strategies not just at the moment of cancel but across the entire subscriber lifecycle.Go through ourdocumentationto know more.
  1. Retention
  2. Settings and Installation
  3. Navigating the Chargebee Retention Settings Page
  4. Adding Chargebee Retention to ReCharge's Affinity Theme

Adding Chargebee Retention to ReCharge's Affinity Theme

Integrating Chargebee Retention with ReCharge's Affinity theme is as easy as a quick copy and paste. No need to edit HTML or bulky themes.

Step 1: Create an API key for Chargebee Retention in ReCharge and add it to the Chargebee Retention integrations settings.

The first step to get Chargebee Retention integrated with Recharge is to generate an API key in your Recharge App and connect it to Chargebee Retention. To do so, navigate to Recharge > Apps > API Tokens.

image

Here you will have the option to Create an API token. Be sure to give it the following Permission Scope's to ensure all of the Chargebee Retention features work.

image

This will allow us to Enrich sessions with customer data, process cancels and process offers in billing. It will also enable the future Revenue Impact reporting features that will be coming down the road. Once you have your keys generated, copy them and head over to the Chargebee Retention App to connect the Integration via Settings > Integrations > Billing Integrations

image

Here we give you the option to plug in a live key and a test key. We recommend linking your test key to a test billing site that can be used with the Sample Session generator to test the Manage Cancels and Manage Offer features of your integration. We cover this in more detail in this article.

image

Once you have connected the API keys you will see that fields have been mapped and you can now "Manage the integration." You are now ready to setup Enrichment, Manage Cancels and Manage Offers.

Step 2: Set up your Chargebee Retention experiences with your dedicated Integration Consultant. You'll want to

  • Enable offer and cancel management
  • Create or edit the messaging you would like display to your cancellers
  • Provide offers such as Discounts, Pauses and Free gifts
  • Create target audiences and an initial test.

Step 3: Copy the Chargebee Retention Code snippet and add it to the ReCharge Customer Portal.

In ReCharge, Navigate to Storefront > Customer Portal and select the following options.

image

Be sure to select "Embedded in platform storefront" or you'll be sure to get an error message.

image

Next copy and paste the code snippet with your Chargebee Retention app id into the "Header" or "Footer section" of the Customer Portal settings.

image

Step 4: The final step is to simply click "Save". Cancellers will now be redirected to Chargebee Retention.

image

Sample snippet

The following code snippet is provided as an example that can be used with an updated Chargebee Retention app_id and can be customized if desired.

<pre><code><script type="text/javascript" src="https://app.brightback.com/js/current/brightback.js"></script>
<script>
document.addEventListener('Recharge::extension::cancellation_flow', event => {
 event.preventDefault();
 const { subscription, onSuccess, onError } = event.detail;
 const baseURL = `${window.location.origin}/tools/recurring/portal/${window.ReCharge.customer.hash}`
 const urlParams = new URLSearchParams(window.location.search);
 const sessionToken = urlParams.get('token');
 const customer = window.ReCharge.customer;

 window.Brightback.handleDataPromise({
  app_id: 'RETENTION_APP_ID',
  subscription_id: subscription.id,
  save_return_url: `${baseURL}/overview?token=${sessionToken}`,
  cancel_confirmation_url: `${baseURL}/overview?token=${sessionToken}`
}).then(result => {
  if (result.valid) {
   window.location = result.url;
   } else {
     onError();
   }
  });
});
</script>
</code></pre>

Was this article helpful?