This article explains how Chargebee Retention integrates with Segment - a platform that collects, stores, and routes your user data in real-time.
Chargebee Retention pushes out real-time notifications via Segment.com (as well as via our webhooks), when certain user, cancel and save-related events happen. This sends the raw event data and a payload of user metadata in real-time, without needing a request. This is particularly useful for any situation where real time notifications are critical for your awareness, for feeding data pipelines or warehouses, for real-time customer communications, or for triggering workflow in 3rd party systems (e.g. a post-cancel email).
Chargebee Retention sends data to Segment as Track events (see list below), which includes the event name and properties, as show in the sample Track event posted below. Chargebee Retention also sends a Segment Identify call in sync with the 'page_loaded' event that happens when a user first visits the Chargebee Retention cancel page. This Identify call includes an extensive set of properties about the user (see sample below), and lets you tie a user to their actions and record traits about them.
Connecting Chargebee Retention to Segment takes two steps: 1) set up Chargebee Retention as a "Source" in Segment, then 2) enable the Segment integration from within the Chargebee Retention app.
You will then see a green check mark next to Segment indicating it is connected
What 'Track' events are passed from Chargebee Retention into Segment?
Chargebee Retention sends data to Segment as Track events (below), which include the event name and properties associated with that event:
This is an example payload for a Chargebee Retention 'accept_offer' 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 Retention",
"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 Retention",
"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"
}
}
Chargebee Retention includes an Identify call with each Segment track event, which lets you tie a user to their actions and record traits about them.
{
"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",
}