Segment.com
Chargebee Growth integrates with Twilio Segment, a customer data platform that collects, stores, and routes user data in real time. This integration lets you stream cancel and save-related events from Chargebee Growth directly into Twilio Segment, where they can feed data pipelines, trigger workflows, or power customer communications.
Prerequisites
Before you begin, you need:
- An active Chargebee Growth account with Settings access.
- An active Twilio Segment account with permission to add sources.
How the integration works
When users interact with a Chargebee Growth cancel page, Chargebee Growth sends two types of calls to Twilio Segment:
- Track events — fired for specific user actions. Each event includes the event name and a set of associated properties. For the full list, see What Track events are sent to Twilio Segment?.
- Identify calls — sent in sync with the
page_loadedevent, which fires the first time a user visits a Chargebee Growth cancel page. The Identify call includes an extensive set of user properties and lets you tie a user to their actions and record traits about them.
Both calls are sent in real time without requiring a request from your system.
Set up the Twilio Segment integration
Connecting Chargebee Growth to Twilio Segment requires two steps: adding Chargebee Growth as a source in Twilio Segment, then enabling the integration in Chargebee Growth.
Step 1: Add Chargebee Growth as a source in Twilio Segment
- Log in to your Twilio Segment account.
- Under Overview, click Add a Source.
- In the Catalog search, enter
HTTP APIand select HTTP API from the results. - Click Connect.
- Enter a name for the source under Source Setup, then click Add Source.
- After the source is created, locate and copy your Write Key.
Step 2: Enable Twilio Segment in Chargebee Growth
- Log in to Chargebee Growth and click Settings > Integrations > Twilio Segment.
- Click Connect.
- In the modal that appears, paste your Write Key into the field provided.
- Click Save & Continue.
A green check mark next to Twilio Segment confirms the connection is active.
What Track events are sent to Twilio Segment?
Chargebee Growth sends the following Track events to Twilio Segment. Each event includes the event name and the properties associated with that action.
| Event name | Description |
|---|---|
| page_loaded | User has visited a Chargebee Growth cancel page. |
| watchlist | User has first visited the Chargebee Growth page and has not canceled within 30 minutes. |
| cancel | User has confirmed the Chargebee Growth cancel request. |
| save | The Watch List session has expired, and the user did not cancel. |
| deflect | Any action has been clicked by the user to leave Chargebee Growth, including email, link, chat, offer, or schedule. |
| User has clicked the modal-based feedback submission. | |
| link | Any link on Chargebee Growth has been clicked (includes modal actions and "Nevermind"). |
| chat | A chat request has been clicked. |
| accept_offer | An offer-type modal was clicked. |
| schedule | A modal-based schedule request was clicked. |
Sample payloads
Sample Track event payload
The following is an example payload for a Chargebee Growth accept_offer Twilio Segment Track event.
{
"event": "accept_offer",
"integrations": {},
"messageId": "1c296cd0-509f-477e-bbc2-bd07e5b33d06",
"originalTimestamp": "2020-11-06T00:53:10.886Z",
"properties": {
"app_id": "9Nyv3KZvQJ",
"client_timestamp": "2020-11-06T00:53:10.815Z",
"field.cancel.account.billing_id": "",
"field.cancel.account.company_domain": "http://example.com",
"field.cancel.account.company_name": "Chargebee Growth",
"field.cancel.account.created_at": "1604621298",
"field.cancel.account.internal_id": "9f827f6",
"field.cancel.account.plan": "Premium",
"field.cancel.account.plan_term": "monthly",
"field.cancel.account.value": "1234",
"field.cancel.app_id": "9Nyv3KZvQJ",
"field.cancel.cancel_confirmation_url": "http://example.com?cancel_confirmation_url",
"field.cancel.custom.test": "value",
"field.cancel.email": "jane@example.com",
"field.cancel.first_name": "Jane",
"field.cancel.last_name": "Brighteyes",
"field.cancel.save_return_url": "http://example.com?save_return_url",
"field.cancel.subscription_id": "",
"field.cancel.timestamp": "2020-11-06T00:50:48.207Z",
"field.cookie": "86807c85-294c-4007-8a1d-9218dd52a714",
"field.integrations.intercom.app_id": "vqcjqxff",
"field.session_id": "1kbVVDN7b6",
"field.standard.Cancel confirmation URL": "http://example.com?cancel_confirmation_url",
"field.standard.Contract Value": 1234,
"field.standard.Domain": "http://example.com",
"field.standard.First Purchase Date": "2020-11-06T00:08:18.000Z",
"field.standard.Instance ID": "9f827f6",
"field.standard.Organization Name": "Chargebee Growth",
"field.standard.Owner Email": "jane@example.com",
"field.standard.Owner First Name": "Jane",
"field.standard.Owner Last Name": "Brighteyes",
"field.standard.Save return URL": "http://example.com?save_return_url",
"funnel_id": 769,
"modal_name": "25_discount.modal_email_send.a5ce8f6c-f35e-4112-80ba-75ccaa75a8f5",
"session": "1kbVVDN7b6",
"survey.brightback_reason": "too_expensive",
"survey.competition": "",
"survey.confirmation": "false",
"survey.display_reason": "Pricing - don't see value",
"survey.feedback": "",
"survey.reason_for_leaving[0].lives_on": "tier0",
"survey.reason_for_leaving[0].name": "reason_for_leaving",
"survey.reason_for_leaving[0].tier": "tier0",
"survey.reason_for_leaving[0].value": "pricing_dont_see_value.1834045247",
"survey.selected_reason": "pricing_dont_see_value.1834045247",
"survey.sentiment": 0,
"user_cookie": "86807c85-294c-4007-8a1d-9218dd52a714",
"user_id": "KD21akKyAZ",
"version": "5a68148b"
}
}
Sample Identify call payload
Chargebee Growth includes an Identify call alongside each Track event to tie user actions to a known user profile and record traits.
{
"anonymousId": "KD21akKyAZ",
"context": {
"library": {
"name": "unknown",
"version": "unknown"
}
},
"integrations": {},
"messageId": "61932cbd-de99-48d7-891e-2dfa0555c845",
"originalTimestamp": "2020-11-06T00:52:40.831Z",
"receivedAt": "2020-11-06T00:52:50.887Z",
"sentAt": "2020-11-06T00:52:50.829Z",
"timestamp": "2020-11-06T00:52:40.889Z",
"traits": {
"cancel.account.billing_id": "",
"cancel.account.company_domain": "http://example.com",
"cancel.account.company_name": "Example",
"cancel.account.created_at": "1604621298",
"cancel.account.internal_id": "9f827f6",
"cancel.account.plan": "Premium",
"cancel.account.plan_term": "monthly",
"cancel.account.value": "1234",
"cancel.app_id": "9Nyv3KZvQJ",
"cancel.cancel_confirmation_url": "http://example.com?cancel_confirmation_url",
"cancel.custom.test": "value",
"cancel.email": "jane@example.com",
"cancel.first_name": "Jane",
"cancel.last_name": "Brighteyes",
"cancel.save_return_url": "http://example.com?save_return_url",
"cancel.subscription_id": "",
"cancel.timestamp": "2020-11-06T00:50:48.207Z",
"user_cookie": "86807c85-294c-4007-8a1d-9218dd52a714",
"user_id": "KD21akKyAZ"
},
"type": "identify",
"userId": "9f827f6"
}
Pass Twilio Segment data to Chargebee Growth
Chargebee Growth can also receive data from Twilio Segment to enrich your Chargebee Growth experiences and offers. You do this by adding a few lines of code to your Chargebee Growth JavaScript snippet. These traits can then be mapped in Field Mapping and used to personalize pages or define custom audiences in Chargebee Growth.
For help configuring your JavaScript snippet to include Twilio Segment data, contact Chargebee Support.
Was this article helpful?