|
| 1 | +--- |
| 2 | +title: Gong |
| 3 | +sidebarTitle: Gong |
| 4 | +--- |
| 5 | + |
| 6 | +This documentation describes the integration of MindsDB with [Gong](https://www.gong.io/), a conversation intelligence platform that captures, analyzes, and provides insights from customer conversations. |
| 7 | +The integration allows MindsDB to access call recordings, transcripts, analytics, and other conversation data from Gong and enhance it with AI capabilities. |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +Before proceeding, ensure the following prerequisites are met: |
| 12 | + |
| 13 | +1. Install MindsDB locally via [Docker](https://docs.mindsdb.com/setup/self-hosted/docker) or [Docker Desktop](https://docs.mindsdb.com/setup/self-hosted/docker-desktop). |
| 14 | +2. To connect Gong to MindsDB, install the required dependencies following [this instruction](https://docs.mindsdb.com/setup/self-hosted/docker#install-dependencies). |
| 15 | +3. Obtain a Gong API key from your [Gong API settings page](https://app.gong.io/settings/api-keys). |
| 16 | + |
| 17 | +## Connection |
| 18 | + |
| 19 | +Establish a connection to Gong from MindsDB by executing the following SQL command and providing its handler name as an engine. |
| 20 | + |
| 21 | +### Using Bearer Token (Recommended) |
| 22 | + |
| 23 | +```sql |
| 24 | +CREATE DATABASE gong_datasource |
| 25 | +WITH |
| 26 | + ENGINE = 'gong', |
| 27 | + PARAMETERS = { |
| 28 | + "api_key": "your_gong_api_key_here" |
| 29 | + }; |
| 30 | +``` |
| 31 | + |
| 32 | +### Using Basic Authentication |
| 33 | + |
| 34 | +```sql |
| 35 | +CREATE DATABASE gong_datasource |
| 36 | +WITH |
| 37 | + ENGINE = 'gong', |
| 38 | + PARAMETERS = { |
| 39 | + "access_key": "your_access_key", |
| 40 | + "secret_key": "your_secret_key" |
| 41 | + }; |
| 42 | +``` |
| 43 | + |
| 44 | +Required connection parameters include the following: |
| 45 | + |
| 46 | +**Authentication (choose one method):** |
| 47 | + |
| 48 | +* `api_key`: Bearer token for authentication (recommended) |
| 49 | +* `access_key` + `secret_key`: Basic authentication credentials (alternative method) |
| 50 | + |
| 51 | +Optional connection parameters include the following: |
| 52 | + |
| 53 | +* `base_url`: Gong API base URL. This parameter defaults to `https://api.gong.io`. |
| 54 | +* `timeout`: Request timeout in seconds. This parameter defaults to `30`. |
| 55 | + |
| 56 | +<Note> |
| 57 | +If both authentication methods are provided, basic auth (`access_key` + `secret_key`) takes precedence. |
| 58 | +</Note> |
| 59 | + |
| 60 | +## Usage |
| 61 | + |
| 62 | +The following usage examples utilize `gong_datasource` as the datasource name, which is defined in the `CREATE DATABASE` command. |
| 63 | + |
| 64 | +### Available Tables |
| 65 | + |
| 66 | +The Gong handler provides access to the following tables: |
| 67 | + |
| 68 | +* `calls` - Access call recordings and metadata |
| 69 | +* `users` - Get user information and permissions |
| 70 | +* `analytics` - Access AI-generated conversation insights |
| 71 | +* `transcripts` - Get full conversation transcripts |
| 72 | + |
| 73 | +### Basic Queries |
| 74 | + |
| 75 | +Retrieve recent calls with date filters (recommended for best performance): |
| 76 | + |
| 77 | +```sql |
| 78 | +SELECT * |
| 79 | +FROM gong_datasource.calls |
| 80 | +WHERE date >= '2024-01-01' AND date < '2024-02-01' |
| 81 | +ORDER BY date DESC |
| 82 | +LIMIT 20; |
| 83 | +``` |
| 84 | + |
| 85 | +Get all users in your organization: |
| 86 | + |
| 87 | +```sql |
| 88 | +SELECT user_id, name, email, role, status |
| 89 | +FROM gong_datasource.users |
| 90 | +LIMIT 100; |
| 91 | +``` |
| 92 | + |
| 93 | +Get analytics for calls with high sentiment scores: |
| 94 | + |
| 95 | +```sql |
| 96 | +SELECT call_id, sentiment_score, key_phrases, topics |
| 97 | +FROM gong_datasource.analytics |
| 98 | +WHERE sentiment_score > 0.7 |
| 99 | + AND date >= '2024-01-01' |
| 100 | +LIMIT 50; |
| 101 | +``` |
| 102 | + |
| 103 | +Get transcripts for a specific call: |
| 104 | + |
| 105 | +```sql |
| 106 | +SELECT speaker, timestamp, text |
| 107 | +FROM gong_datasource.transcripts |
| 108 | +WHERE call_id = '12345' |
| 109 | +ORDER BY timestamp; |
| 110 | +``` |
| 111 | + |
| 112 | +### Advanced Queries with JOINs |
| 113 | + |
| 114 | +Get calls with their sentiment analysis: |
| 115 | + |
| 116 | +```sql |
| 117 | +SELECT |
| 118 | + c.title, |
| 119 | + c.date, |
| 120 | + c.duration, |
| 121 | + a.sentiment_score, |
| 122 | + a.key_phrases |
| 123 | +FROM gong_datasource.calls c |
| 124 | +JOIN gong_datasource.analytics a ON c.call_id = a.call_id |
| 125 | +WHERE c.date >= '2024-01-01' AND c.date < '2024-02-01' |
| 126 | +ORDER BY a.sentiment_score DESC |
| 127 | +LIMIT 25; |
| 128 | +``` |
| 129 | + |
| 130 | +Find calls where specific keywords were mentioned: |
| 131 | + |
| 132 | +```sql |
| 133 | +SELECT |
| 134 | + c.title, |
| 135 | + c.date, |
| 136 | + t.speaker, |
| 137 | + t.text |
| 138 | +FROM gong_datasource.calls c |
| 139 | +JOIN gong_datasource.transcripts t ON c.call_id = t.call_id |
| 140 | +WHERE c.date >= '2024-01-01' |
| 141 | + AND t.text LIKE '%pricing%' |
| 142 | +LIMIT 50; |
| 143 | +``` |
| 144 | + |
| 145 | +Get user performance with call sentiment: |
| 146 | + |
| 147 | +```sql |
| 148 | +SELECT |
| 149 | + u.name, |
| 150 | + u.email, |
| 151 | + c.call_id, |
| 152 | + c.title, |
| 153 | + a.sentiment_score |
| 154 | +FROM gong_datasource.users u |
| 155 | +JOIN gong_datasource.calls c ON u.user_id = c.user_id |
| 156 | +JOIN gong_datasource.analytics a ON c.call_id = a.call_id |
| 157 | +WHERE c.date >= '2024-01-01' |
| 158 | + AND a.sentiment_score > 0.8 |
| 159 | +LIMIT 100; |
| 160 | +``` |
| 161 | + |
| 162 | +## Data Schema |
| 163 | + |
| 164 | +### calls Table |
| 165 | + |
| 166 | +| Column | Description | |
| 167 | +|--------|-------------| |
| 168 | +| `call_id` | Unique identifier for the call (Primary Key) | |
| 169 | +| `title` | Call title or description | |
| 170 | +| `date` | Call date and time (ISO-8601 format) | |
| 171 | +| `duration` | Call duration in seconds | |
| 172 | +| `recording_url` | URL to the call recording | |
| 173 | +| `call_type` | Type of call (e.g., "sales", "demo") | |
| 174 | +| `user_id` | ID of the user who made the call | |
| 175 | +| `participants` | Comma-separated list of participants | |
| 176 | +| `status` | Call status | |
| 177 | + |
| 178 | +### users Table |
| 179 | + |
| 180 | +| Column | Description | |
| 181 | +|--------|-------------| |
| 182 | +| `user_id` | Unique identifier for the user (Primary Key) | |
| 183 | +| `name` | User's full name | |
| 184 | +| `email` | User's email address | |
| 185 | +| `role` | User's role in the organization | |
| 186 | +| `permissions` | Comma-separated list of user permissions | |
| 187 | +| `status` | User status | |
| 188 | + |
| 189 | +### analytics Table |
| 190 | + |
| 191 | +| Column | Description | |
| 192 | +|--------|-------------| |
| 193 | +| `call_id` | Reference to the call (Primary Key, Foreign Key to calls.call_id) | |
| 194 | +| `sentiment_score` | Sentiment analysis score | |
| 195 | +| `topic_score` | Topic detection score | |
| 196 | +| `key_phrases` | Comma-separated list of key phrases | |
| 197 | +| `topics` | Comma-separated list of detected topics | |
| 198 | +| `emotions` | Comma-separated list of detected emotions | |
| 199 | +| `confidence_score` | Confidence score for the analysis | |
| 200 | + |
| 201 | +### transcripts Table |
| 202 | + |
| 203 | +| Column | Description | |
| 204 | +|--------|-------------| |
| 205 | +| `segment_id` | Unique identifier for the transcript segment (Primary Key) | |
| 206 | +| `call_id` | Reference to the call (Foreign Key to calls.call_id) | |
| 207 | +| `speaker` | Name of the speaker | |
| 208 | +| `timestamp` | Timestamp of the transcript segment (ISO-8601 format) | |
| 209 | +| `text` | Transcribed text | |
| 210 | +| `confidence` | Confidence score for the transcription | |
| 211 | + |
| 212 | +## Troubleshooting |
| 213 | + |
| 214 | +<Warning> |
| 215 | +`Authentication Error` |
| 216 | + |
| 217 | +* **Symptoms**: Failure to connect MindsDB with Gong. |
| 218 | +* **Checklist**: |
| 219 | + 1. Verify that your Gong API key is valid and not expired. |
| 220 | + 2. Ensure you have the necessary permissions in Gong to access the API. |
| 221 | + 3. Check that your API key has access to the specific data you're querying. |
| 222 | + 4. If using basic authentication, verify both `access_key` and `secret_key` are correct. |
| 223 | +</Warning> |
| 224 | + |
| 225 | +<Warning> |
| 226 | +`Empty Results or Missing Data` |
| 227 | + |
| 228 | +* **Symptoms**: Queries return no results or incomplete data. |
| 229 | +* **Checklist**: |
| 230 | + 1. Verify that date filters are included in your query (required for calls, analytics, transcripts). |
| 231 | + 2. Check that the date range includes data (analytics and transcripts have ~1 hour lag). |
| 232 | + 3. Ensure call_id exists when querying transcripts for a specific call. |
| 233 | + 4. Verify that your Gong account has data for the requested time period. |
| 234 | +</Warning> |
| 235 | + |
| 236 | +<Warning> |
| 237 | +`Slow Query Performance` |
| 238 | + |
| 239 | +* **Symptoms**: Queries take a long time to execute. |
| 240 | +* **Checklist**: |
| 241 | + 1. Add date filters to limit the data range (essential for large datasets). |
| 242 | + 2. Use LIMIT to restrict the number of results. |
| 243 | + 3. Filter by call_id when querying transcripts. |
| 244 | + 4. Avoid querying transcripts without filters (can return thousands of rows per call). |
| 245 | +</Warning> |
0 commit comments