Segment.com Integration
This article explains how Brightback integrates with Segment - a platform that collects, stores, and routes your user data in real-time.
Overview
Brightback 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).
How it works
Brightback 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. Brightback also sends a Segment Identify call in sync with the 'page_loaded' event that happens when a user first visits the Brightback 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 Brightback to Segment takes two steps: 1) set up Brightback as a "Source" in Segment, then 2) enable the Segment integration from within the Brightback app.
Part 1: Set up Brightback as a Source in Segment.com
- Login to Segment Account
- Under Overview, click "Add a Source"
- Under Catalog, type in "HTTP API" which should pop up on the right
- Click "HTTP API" and then click "Connect"
- Add a name under source Setup and click "Add Source"
- Once you add a source, you should see a write Key
- Copy your write key from the clipboard
Part 2: Connect Segment in the Brightback App
- Log in to Brightback and click Settings in the lower left hand corner
- On the left side, see “Integrations”
- Navigate to “Segment” listed under “Integrations” and click “Connect”
- The modal will pop up that lists the benefits of connecting to Segment
- Paste your write key into the modal click "Save and Continue"
You will then see a green check mark next to Segment indicating it is connected
What 'Track' events are passed from Brightback into Segment?
Brightback sends data to Segment as Track events (below), which include the event name and properties associated with that event:
- page_loaded: user has visited a Brightback cancel page
- watchlist: user has first visited Brightback page and not canceled within 30 mins
- cancel: user has confirmed the Brightback 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 Brightback, including email, link, chat, offer, or schedule
- email: user has clicked the modal-based Feedback submission
- link: any link on Brightback 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 Segment 'track' event payload
This is an example payload for a Brightback '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://brightback.com", "field.cancel.account.company_name": "BrightBack", "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://brightback.com?cancel_confirmation_url", "field.cancel.context.locale": "en-US", "field.cancel.context.referrer": "https://app.brightback.com/dev/events/vjRWMdZd4Y", "field.cancel.context.timezone": "America/Los_Angeles", "field.cancel.context.url": "https://app.brightback.com/dev/trackerjs", "field.cancel.context.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36", "field.cancel.custom.test": "value", "field.cancel.email": "jane@brightback.com", "field.cancel.first_name": "Jane", "field.cancel.last_name": "Brighteyes", "field.cancel.save_return_url": "http://brightback.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://brightback.com?cancel_confirmation_url", "field.standard.Contract Value": 1234, "field.standard.Domain": "http://brightback.com", "field.standard.First Purchase Date": "2020-11-06T00:08:18.000Z", "field.standard.Instance ID": "9f827f6", "field.standard.Organization Name": "BrightBack", "field.standard.Owner Email": "jane@brightback.com", "field.standard.Owner First Name": "Jane", "field.standard.Owner Last Name": "Brighteyes", "field.standard.Save return URL": "http://brightback.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" } } <br>
Sample Segment 'Identify' call
Brightback 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": { "active": true, "app": { "build": "5a68148b", "name": "Brightback", "namespace": "com.production.brightback", "version": "0.1-SNAPSHOT" }, "library": { "name": "analytics-java", "version": "2.1.1" }, "locale": "en-US", "page": { "referrer": "https://app.brightback.com/dev/events/vjRWMdZd4Y", "url": "https://app.brightback.com/dev/trackerjs" }, "timezone": "America/Los_Angeles", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36" }, "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://brightback.com", "cancel.account.company_name": "BrightBack", "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://brightback.com?cancel_confirmation_url", "cancel.custom.test": "value", "cancel.email": "jane@brightback.com", "cancel.first_name": "Jane", "cancel.last_name": "Brighteyes", "cancel.save_return_url": "http://brightback.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", "writeKey": "12345678901234567890" } <br>