Docs

Enrichment with Chargebee, Stripe, Recurly 

Chargebee Retention's Enrichment integration with Stripe and Recurly allows you to pull in fields from your canceller's subscription information and map them to fields in Chargebee Retention for use in both personalization, targeting, and data segmentation. Once you have connected your billing provider, available fields will be present in the Field Mappings page under Settings in your admin app.

Setting up Chargebee Retention.js 

All that is required for the Enrichment feature to work properly is a valid connection to your subscription provider and your canceller's unique subscription ID populated dynamically at load time. This subscription ID varies by provider, so please see below for your specific configuration details. With a valid subscription id and provider connection, the following code snippet is all that is needed to create a session.

<script type="text/javascript" src="https://app.retention.chargebee.com/js/current/brightback.js?compiled=true"></script>
<script type="text/javascript">
  if (window.Brightback) {
    window.Brightback.handleData({
      app_id: 'RETENTION_APP_ID',
      subscription_id: 'sub_abcdefghijk'
    });
  }
</script>

Leveraging the simple enrichment feature reduces engineering time and effort for the Chargebee Retention snippet installation. With integration enabled Chargebee Retention will use the id to lookup key customer details in the billing system and populate the experience with these fields. If you need help integrating any of these systems with Chargebee Retention, please visit this page.

Warning

If you do not send a valid subscription id or have a valid provider connection will not be able to pull subscription information at load time. Your canceller would see your control or default cancel experience and personalization will default to the fallback variables.

Recurly 

Once you are integrated with Recurly, you will want to ensure that you are passing the subscription UUID via the Chargebee Retention JS and have this field mapped to the Subscription ID in the field mappings page.

Chargebee Retention standard fields 

Chargebee Retention custom fields 

For more information on what subscription information is passed and where to find the subscription id, please reference this doc in Recurly's help center. Once you have successfully connected, you will be able to select fields by field type from Recurly under field mapping.

Example Recurly payload 

"subscription.account.email" : "jane@chargebee.com",
"subscription.account.first_name": "Jane",
"subscription.account.last_name" : "Bee",
"subscription.account.id": "1234567890",
"subscription.account.created": "1970-01-01T00:00:00Z"
"subscription.activated_at": "1970-01-01T00:00:00Z",
"subscription.created_at": "1970-01-01T00:00:00Z",
"subscription.id": "123456781234123412341231567891234",
"subscription.plan.code": "premium_snack_pack",
"subscription.plan.id" : "1234567890",
"subscription.plan.interval_unit" : "months",
"subscription.plan.interval_length" : 12,
"subscription.trial_started_at" : "1970-01-01T00:00:00Z",
"subscription.unit_amount": 1.0

Missing a field? Please contact retention-support@chargebee.com and we'll look into adding it.

Stripe 

For more information on looking up subscriptions in Stripe, please visit Stripe Docs on Retrieving a subscription. Once you are integrated with Stripe, you will want to ensure that you are passing the Stripe subscription id via the Chargebee Retention JS and have this field mapped to the Subscription ID in the field mappings page.

Once you have successfully connected, you will be able to select fields by field type from Stripe under field mapping.


Go ahead and map as many fields as you would like. Mapped fields can be used to personalize the cancel page, target the cancel experience/offers, and in reporting via the customer's page.

Example Stripe payload 

"subscription.customer.email": "jane@chargebee.com",
"subscription.plan.interval": "year",
"subscription.plan.id": "premium_snack_pack",
"subscription.id": "sub_abcdefghijk",
"subscription.current_period_end": 946684800,
"subscription.plan.billing_scheme": "per_unit",
"subscription.customer.created": 946684800,
"subscription.trial_start_date": 946684800,
"subscription.plan.amount_decimal": 99000,
"subscription.trial_end_date": 946684800,
"subscription.product.name": "Premium Snack Pack",
"subscription.start_date": 946684800,
"subscription.customer.id": "cus_abcdefghijk",
"subscription.plan.interval_count": 1,
"subscription.product.id": "prod_abcdefghijk",
"subscription.created": 946684800,
"subscription.current_period_start": 946684800

Missing a field? Please contact retention-support@chargebee.com and we'll look into adding it.

Was this article helpful?
Loading…