> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gainsight Integration

> Connect Gainsight to sync survey responses, activity timelines, product usage, and company data into Statisfy as a secondary CRM source.

# Gainsight Integration

Connect Gainsight to bring your customer success data — surveys, activity
timelines, product usage metrics, and company attributes — into Statisfy
alongside your primary CRM.

<Warning>
  **Gainsight cannot be your primary CRM in Statisfy.** Salesforce or HubSpot
  must own the canonical account record (domain, parent hierarchy, ARR,
  renewal dates, owners). Gainsight runs as a *secondary* CRM that adds
  Gainsight-specific data on top of accounts your primary CRM already
  manages. If you connect Gainsight without a primary CRM connected first,
  data ingestion is gated and will not sync.
</Warning>

## Overview

The Gainsight integration is unique among Statisfy CRM connectors: a single
connection fans out into **four independent pull jobs**, each pulling a
different Gainsight object on its own schedule. You configure which objects
to sync from the Gainsight settings wizard.

| Object                | Schedule      | What it does                                                                                               |
| --------------------- | ------------- | ---------------------------------------------------------------------------------------------------------- |
| **Account / Company** | Daily         | Enriches existing customer records with Gainsight company-level fields.                                    |
| **Activity**          | Every 4 hours | Pulls activity-timeline entries (meetings, calls, emails, updates) and routes them as customer activities. |
| **Surveys**           | Daily         | Pulls NPS / CSAT / custom survey responses as activities.                                                  |
| **Product Usage**     | Weekly        | Pulls product-usage metrics from a configurable Gainsight object and aggregates them per customer.         |

## Prerequisites

* **Admin access** to both Gainsight and Statisfy.
* **Salesforce or HubSpot already connected** in Statisfy as your primary
  CRM (see [Salesforce Integration](/integrations/salesforce) or
  [HubSpot Integration](/integrations/hubspot_integration)).
* A Gainsight **API key** and your tenant's **base URL** (your CSM can help
  you generate the key from Gainsight's Connectors 2.0 admin).

## Connection

1. Navigate to **Integrations → Admin Apps → Gainsight → Connect** in
   Statisfy.
2. Provide your Gainsight base URL (e.g.
   `https://your-tenant.gainsightcloud.com`) and API key.
3. After saving, the connector status flips to **Connected**.
4. Open **Integrations → Gainsight → Settings** to configure which objects
   to sync.

<Tip>
  The Gainsight settings page has a **Validate connection** button in the
  Connection Status card — click it any time to confirm Statisfy can still
  authenticate against your Gainsight base URL. The button reports the number
  of Gainsight objects discovered, which is a quick sanity check on your
  credentials.
</Tip>

## Configuring objects in the wizard

The wizard is organized as one accordion per Gainsight object you can
sync, plus a Common section for cross-cutting settings. The **Object sync
status** banner at the top of the page shows the most recent execution per
object you've configured, with per-row Run buttons.

### Common settings

The Common section has one field: **Gainsight GSID field on Salesforce**.

This is the Salesforce Account field that stores each account's Gainsight
GSID. Statisfy uses it as a fallback lookup when Gainsight's `GsCompanyId`
on a record doesn't directly match an account in Statisfy. Pick the field
from the dropdown (sourced live from your Salesforce Account schema).

<Note>
  Each object section also has its own "GSID field override" picker. Use it
  only when a specific Gainsight pull (e.g. Activity) needs a *different* SF
  field than the Common one. Most tenants set Common and leave the
  overrides blank.
</Note>

### Account / Company

Toggle **Enable account pull** to schedule a daily Gainsight company sync.
Salesforce remains the source of truth for the account itself (domain,
parent, ARR, renewal date, owners) — this only enables ingestion of
Gainsight-specific company attributes on top.

### Surveys

Pulls survey responses (NPS / CSAT / custom) as activities. Two modes:

* **Single object** — your tenant stores all survey responses in one
  Gainsight object (typically `survey_response`).
* **Multiple objects** — your tenant uses separate objects for NPS, CSAT,
  etc. Add a row per object; each can pin a `survey_type` and override
  field names.

| Knob                              | What it does                                                                                              |
| --------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Survey response object(s)         | The Gainsight object name(s) to query. Picked from a dropdown sourced from your tenant's object list.     |
| Response limit                    | Max records fetched per object per run (default 500).                                                     |
| Lookback days                     | How far back to pull. **Capped at 30**                                                                    |
| Register custom fields            | When ON, every field discovered on the response object is registered as a Statisfy activity custom field. |
| Survey response filter (advanced) | A Gainsight where-clause as a JSON object, overrides the default lookback filter. Optional.               |

<Tip>
  Field-name mappings (proto field → Gainsight field) are auto-detected for
  the standard Gainsight survey schema. Most tenants don't need to override
  them. Power users can edit `field_mappings` directly via the wizard's
  **Show JSON** footer.
</Tip>

### Activity

Pulls Gainsight activity-timeline entries and routes each one to a
Statisfy activity type based on its **ReportingCategory**.

When you enable the section, Statisfy samples up to 1000 activities from
your timeline (with automatic fallback to 800 / 500 on slow tenants) to
populate the category list. The mapping editor pre-seeds with sensible
defaults:

| ReportingCategory | Mapped Activity Type |
| ----------------- | -------------------- |
| `email`           | EMAIL                |
| `meeting`         | MEETING              |
| `call`            | MEETING              |
| `update`          | TYPE\_MANUAL         |
| `risk`            | TYPE\_MANUAL         |

Click the **?** icon next to "ReportingCategory → ActivityType" in the
wizard to see what each ActivityType means. For unknown categories, pick
based on what the activity *is* (a meeting, an email, a manual note),
not what Gainsight calls it.

<Note>
  Categories returned by the live sample but not yet mapped show up as
  quick-add chips below the mapping editor — click one to add a row
  pre-filled with that category and a sensible default ActivityType.
</Note>

### Product Usage

Pulls product-usage metrics from a configurable Gainsight object and rolls
them up to Statisfy customers on a weekly schedule.

| Knob                 | What it does                                                                                  |
| -------------------- | --------------------------------------------------------------------------------------------- |
| Product usage object | The Gainsight object holding usage rows. Picked from a dropdown of your tenant's objects.     |
| Product name         | The Statisfy product label these metrics roll up under (default `product usage`).             |
| Aggregate settings   | Optional. Enable when usage is stored as flat rows that need to be grouped by an account key. |

When **Aggregate settings** is on, Statisfy:

1. Groups records by **Aggregate key** (e.g. `AccountId`).
2. Resolves each group to a Statisfy customer.
3. For each row in the group, extracts metrics where the metric name
   comes from the **Metric name field** and the metric value from
   **Metric value field**. Additional value fields are stored as
   secondary metrics.

All four field pickers (Aggregate key, Dimension key field, Metric name
field, Metric value field) are dropdowns sourced from the chosen Product
usage object's schema.

## Object sync status banner

The banner at the top of the wizard shows one row per *configured*
object (objects you haven't enabled in the wizard don't appear here).
Each row carries:

* The most recent execution: status pill (Running / Completed / Failed)
  and "Started/Completed N min ago".
* A per-row **Run** button that fires only that object.

The header has a **Run all sync jobs** button that fans out to fire one
cloud-run job per row. Per-object failures are isolated — a single
object failing to schedule doesn't abort the rest.

## Troubleshooting

<Accordion title="An object shows 'Never run'">
  The object is configured but a sync hasn't completed yet. Either wait
  for the next scheduled run, or click the row's **Run** button to
  trigger it on demand.
</Accordion>

<Accordion title="Validate connection fails with 401">
  Your Gainsight API key has expired or been rotated. Reconnect from
  **Integrations → Admin Apps → Gainsight** and re-enter the new key.
</Accordion>

<Accordion title="Activity sample fetch is slow / times out">
  Gainsight's `activity_timeline` API is slow on tenants with large
  histories. The wizard automatically falls back from a sample size of
  1000 → 800 → 500 on retry. The Resample button reflects the current
  target — click it to step down further if needed. The frontend allows
  up to 25 seconds for the call.
</Accordion>

<Accordion title="Surveys not appearing in customer timeline">
  * Confirm the survey response object name is correct (use the dropdown,
    not free text).
  * Check that the response object has a non-empty `GsCompanyId` (or your
    configured `gainsight_gsid_field_in_salesforce`) — Statisfy needs it
    to match a customer.
  * For multi-object mode: each row's object name must be unique.
</Accordion>

<Accordion title="Account-level fields look wrong / missing">
  This is expected if Salesforce/HubSpot doesn't have the canonical
  account row yet. Gainsight runs as a secondary CRM and won't create
  accounts that don't already exist in your primary CRM. Confirm the
  account is present in your primary CRM first, then re-run the
  Gainsight sync.
</Accordion>

## Quick setup walkthrough

For a step-by-step first-time setup, see
[Gainsight Integration Steps](/integrations/gainsight_integration).

## Support

Need help? Contact [support@statisfy.com](mailto:support@statisfy.com)
or reach out to your Customer Success Manager.
