# Gainsight Destination

## Destination Info

* Accepts [Group](/docs/segment/connections/spec/group), [Identify](/docs/segment/connections/spec/identify), [Track](/docs/segment/connections/spec/track) calls.
* Refer to it as **Gainsight** in the [Integrations object.](/docs/segment/guides/filtering-data/#filtering-with-the-integrations-object)

### Components

* Server

## Connection Modes

[Learn more about connection modes.](/docs/segment/connections/destinations/#connection-modes)

### Device-Mode

* web: no
* mobile: no
* server: no

### Cloud-Mode

* web: yes
* mobile: yes
* server: yes

[Gainsight](https://www.gainsight.com/) is a customer success software that empowers companies to increase revenue, decrease customer churn, and drive advocacy. Gainsight for Analytics Cloud is the first and only solution that runs predictive data science natively using Salesforce sales, service, marketing, and community data.

## Getting Started

1. From the Segment web app, click **Catalog**.
2. Search for Gainsight in the Catalog, select it, and choose which of your sources to connect the destination to.
3. Copy your Gainsight Access Key and paste it into to the Access Key field in your Segment settings for Gainsight. This key can be generated from the integrations page under the `admin` area in Gainsight. It should be 36 characters long, for reference. If you need more information, visit the [relevant documentation provided by Gainsight](https://support.gainsight.com/SFDC_Edition/Connectors/Connectors/API_Integrations/Generate_API_Access_Key).
4. Start sending events.

## Identify

If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](/docs/segment/connections/spec/identify/) does. An example call would look like this ([analytics.js](/docs/segment/connections/sources/catalog/libraries/website/javascript/)):

```js
analytics.identify('123', {
  accountId: 'o283h08fh2390f923uofu23',
  name: 'Miles Morales',
  email: 'mmorales@midtownhs.edu'
});
```

You can map `identify` calls to Salesforce by including the Salesforce Account ID as `accountId`. Gainsight will handle the rest and collect any additional info you send in your `identify` calls and attribute them to the correct Account.

## Track

**Important**: You should only send the `track` events you need to Gainsight. You can whitelist the names of the events you need in your Segment UI settings for Gainsight. Once you pre-map your events, Segment only sends those events to Gainsight for you. However, if you do *not* map any events, Segment will by default send all your track events to Gainsight.

If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/segment/connections/spec/track/) does. An example call would look like this ([analytics.js](/docs/segment/connections/sources/catalog/libraries/website/javascript/)):

```js
analytics.track('Account Created', {
  accountId: 'o283h08fh2390f923uofu23',
  source: 'Invite',
  title: 'CEO'
});
```

Mapping your `track` calls to a Salesforce Account is only necessary if the user doing the event is not already identified or grouped. If the user is identified, all their events will be picked up automatically.

If they haven't been identified, pass the Salesforce Account ID as a property like in the example above.

## Group

If you're not familiar with the Segment Specs, take a look to understand what the [Group method](/docs/segment/connections/spec/group/) does. An example call would look like this ([analytics.js](/docs/segment/connections/sources/catalog/libraries/website/javascript/)):

```js
analytics.group('555', {
  name: 'Twitter',
  url: 'https://twitter.com'
});
```

To map your `group` calls to a Salesforce Account, pass the Salesforce Account ID as the `groupId`, like what you see in the previous example.

## Engage

You can send computed traits and audiences generated using [Engage](/docs/segment/engage) to this destination as a **user property**. To learn more about Engage, schedule a [demo](https://segment.com/contact/demo).

For user-property destinations, an [identify](/docs/segment/connections/spec/identify/) call is sent to the destination for each user being added and removed. The property name is the snake\_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property `order_completed_last_30days: true`. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to `false`.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

> \[!NOTE]
>
> Real-time audience syncs to Gainsight  may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

## Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

| Field                  | Description                                                                                                                                                                                                                                                                                                                   | Required | Type   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
| Access Key             | It should be 36 characters long, and look something like this: \`35a84f9e-7084-47a1-b8a5-593444e9e862\`.                                                                                                                                                                                                                      | Yes      | string |
| Whitelist Track Events | Whitelist Segment \`.track()\` events you'd like to send to Gainsight. By \*\*default\*\*, if you do not whitelist \_any\_ events, we will send all \`.track()\` events. If you do whitelist any events, we will \*\*only\*\* send those events through. Put the name of your \`.track()\` events here, ie. 'Order Completed' | No       | mixed  |
