New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebee docs
HomeBillingCPQPaymentsRevRecGrowthReveal
Support

Getting Started


  • Overview
  • Installation Guide

Use Cases


  • Acquisition
  • Expansion

Plays


  • Overview
  • Managing Plays

Offers


  • In-app Offers
  • Pricing Tables

Experiences


  • Branding
  • Cancel Pages
  • Loss Aversion Cards
  • Survey Reasons
  • Redirect Pages

People


  • Managing Audiences

Reports & Analytics


  • Key Metrics Glossary
  • Dashboards & Trends
  • Cancel Insights
  • Offer Performance Report
  • Experience Performance Report
  • Lift Report
  • Displaying Revenue in Reports
  • Removing test sessions from Reports

Settings


  • Navigating the Settings page
  • Setting up a Custom Domain
  • Setting up Save & Cancel Return URLs
  • Activity Log and Error Reporting

Managing your Account


  • Growth Admin User Role
  • Managing your Team
  • Managing Teams to Control App Access

Integrations


  • Slack
  • Salesforce
  • Segment.com
  1. Growth
  2. Integrations
  3. Segment.com
Chargebee Retention is now part of Chargebee Growth.New customers can find everything you need in Chargebee Growth documentation.Existing Chargebee Retention customers can continue to access the legacy Chargebee Retention documentationhere.
  1. Growth
  2. Integrations
  3. Segment.com

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_loaded event, 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

  1. Log in to your Twilio Segment account.
  2. Under Overview, click Add a Source.
  3. In the Catalog search, enter HTTP API and select HTTP API from the results.
  4. Click Connect.
  5. Enter a name for the source under Source Setup, then click Add Source.
  6. After the source is created, locate and copy your Write Key.

Step 2: Enable Twilio Segment in Chargebee Growth

  1. Log in to Chargebee Growth and click Settings > Integrations > Twilio Segment.
  2. Click Connect.
  3. In the modal that appears, paste your Write Key into the field provided.
  4. Click Save & Continue.
image

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 nameDescription
page_loadedUser has visited a Chargebee Growth cancel page.
watchlistUser has first visited the Chargebee Growth page and has not canceled within 30 minutes.
cancelUser has confirmed the Chargebee Growth cancel request.
saveThe Watch List session has expired, and the user did not cancel.
deflectAny action has been clicked by the user to leave Chargebee Growth, including email, link, chat, offer, or schedule.
emailUser has clicked the modal-based feedback submission.
linkAny link on Chargebee Growth has been clicked (includes modal actions and "Nevermind").
chatA chat request has been clicked.
accept_offerAn offer-type modal was clicked.
scheduleA 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?