Enrichment with Stripe, Recurly or Chargebee

Brightback's Enrichment integration with Stripe, Recurly, and Chargebee allows you to pull in fields from your canceller's subscription information and map them to fields in Brightback 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 Brightback.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.brightback.com/js/current/brightback.js?compiled=true"></script>
<script type="text/javascript">
  if (window.Brightback) {
    window.Brightback.handleData({
      app_id: '1234567890',              // Your static app_id with Brightback
      subscription_id: 'sub_abcdefghijk' // Subscription ID from your billing system
    });
  }
</script>

Leveraging the simple enrichment feature reduces engineering time and effort for the Brightback snippet installation.  With integration enabled Brightback 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 Brightback, please visit this page.

A note about the subscription id:

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 w/ Recurly, you will want to ensure that you are passing the subscription UUID via the Brightback JS and have this field mapped to the Subscription ID in the field mappings page.

Brightback standard fields

Brightback 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@brightback.com",
"subscription.account.first_name": "Jane",
"subscription.account.last_name" : "Brightback",
"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 support@brightback.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 w/ Stripe, you will want to ensure that you are passing the Stripe subscription id via the Brightback 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@brightback.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 support@brightback.com and we'll look into adding it.

Chargebee

For more information on looking up subscriptions in Chargebee, please visit Chargebee Docs on Retrieving a subscription. Once you are integrated w/ Chargebee, you will want to ensure that you are passing the Chargebee subscription id via the Brightback 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 Chargebee 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 Chargebee payload

"subscription.started_at" : "1970-01-01T00:00:00Z",
"subscription.customer.company_name" : "Brigthback",
"subscription.id" : "premium_snack_pack",
"subscription.activated_at" : "1970-01-01T00:00:00Z",
"subscription.created_at" : "1970-01-01T00:00:00Z",
"subscription.customer.last_name" : "Brightback",
"subscription.plan_quantity" : 1,
"subscription.plan_unit_price" : 99,
"subscription.mrr" : 99,
"subscription.billing_period_unit" : "MONTH",
"subscription.billing_period" : 1,
"subscription.customer.created_at" : "1970-01-01T00:00:00Z",
"subscription.plan_id" : "cbdemo_prem_s_p",
"subscription.customer.email" : "jane@brightback.com",
"subscription.plan_amount" : 99000,
"subscription.customer.first_name" : "Jane",
"subscription.customer.id" : "cb_janebb"

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

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us