How to Integrate Gong with Your Headless CMS
Connect Gong to your headless CMS so approved sales plays, objection handling, and account proof points reach reps inside revenue workflows without copy-paste drift.
What is Gong?
Gong is a revenue intelligence platform that records, transcribes, and analyzes sales conversations across calls, emails, and web meetings. Sales, customer success, enablement, and revenue operations teams use it to review deals, coach reps, inspect pipeline, and understand what customers are actually saying. It’s one of the best-known platforms in the CRM and sales intelligence category, often connected to tools like Salesforce, HubSpot, Outreach, Zoom, and Google Meet.
Why integrate Gong with a headless CMS?
Sales teams move fast, but sales content usually moves slower. A pricing objection changes, a competitor launches a new feature, or a customer story gets approved, and the update has to reach reps before their next call. If Gong is where managers coach calls and reps review deals, your approved messaging shouldn’t live in a disconnected PDF, spreadsheet, or old wiki page.
Architecture overview
A typical Sanity and Gong integration starts with structured sales content in the Content Lake, such as a salesPlay, competitorBattlecard, objectionResponse, or caseStudy document. When an editor publishes one of those documents in Sanity Studio, a webhook fires with the document ID, or a Sanity Function runs directly on the content mutation. The Function uses @sanity/client and GROQ to fetch the exact fields Gong needs, including joined references like product, segment, region, owner, and related proof points. It then maps that data into Gong’s API shape and calls Gong over HTTPS using an API access key and secret with Basic authentication. For teams using Gong’s CRM ingestion flow, the sync writes the content URL, summary, talk track, and external IDs to the CRM objects Gong uses for account, opportunity, or contact context. Reps and managers then see the updated context while reviewing calls, coaching deals, or inspecting pipeline in Gong. If you don’t want server code outside Sanity, Functions can handle the event processing and API call without running a separate webhook service.
Common use cases
Call coaching with approved talk tracks
Publish a new objection response in Sanity and sync the approved wording to Gong-linked deal context so managers coach against the current message.
Account-specific proof points
Connect industry, region, and product tags in Sanity to Gong account or opportunity records so reps can find the right case study before a call.
Competitor battlecard updates
When a battlecard changes, send the latest positioning, traps to avoid, and discovery questions into the Gong workflow your sales team already uses.
Closed-loop messaging analysis
Use Gong call themes to identify content gaps, then publish corrected messaging in Sanity and push it back into sales workflows.
Step-by-step integration
- 1
Set up Gong API access
In Gong, create an API access key and secret from the company settings area for API integrations. Confirm which Gong API surface your plan supports, such as Calls API for reading conversation data or CRM ingestion APIs for writing external CRM context that Gong can use. Store the access key, secret, and any Gong integration ID in environment variables.
- 2
Install the Sanity client and choose your runtime
For a TypeScript integration, install @sanity/client and run the sync in a Sanity Function, a Next.js route handler, or a small Node service. If you use Sanity Functions, your code can run when content changes without a separate queue, cron job, or hosted webhook listener.
- 3
Model sales content in Sanity Studio
Create schemas for salesPlay, objectionResponse, competitorBattlecard, and caseStudy. Include fields Gong needs for matching and display, such as title, summary, segment, product, industry, region, crmExternalId, gongObjectType, talkTrack, proofPoints, sourceUrl, and updatedAt.
- 4
Create a publish trigger
Add a Sanity webhook or Function trigger filtered to published sales content, for example _type in ['salesPlay', 'objectionResponse', 'competitorBattlecard']. Send only the document ID in the event, then fetch the full document with GROQ inside the handler so you control exactly which fields leave Sanity.
- 5
Map Sanity fields to Gong data
Build a small mapper that turns structured Sanity fields into Gong or Gong-linked CRM fields. For example, map salesPlay.title to a play_name field, talkTrack to current_talk_track, proofPoints[] to approved_proof_points, and crmExternalId to the account or opportunity ID Gong uses for matching.
- 6
Test the full path with one record
Publish one test sales play in a staging dataset, inspect the Function logs, confirm the Gong API response, and verify the update in Gong or in the CRM record Gong reads. Then test updates, deletes, missing external IDs, and permission failures before turning on the trigger for production content.
Code example
import {createClient} from '@sanity/client'
const sanity = createClient({
projectId: process.env.SANITY_PROJECT_ID!,
dataset: process.env.SANITY_DATASET!,
apiVersion: '2025-02-19',
token: process.env.SANITY_READ_TOKEN!,
useCdn: false,
})
const auth = Buffer.from(
`${process.env.GONG_ACCESS_KEY}:${process.env.GONG_ACCESS_SECRET}`
).toString('base64')
export async function handler(req: Request) {
const event = await req.json()
const id = event.ids?.created?.[0] || event.ids?.updated?.[0]
if (!id) return new Response('No document ID', {status: 202})
const play = await sanity.fetch(`
*[_id == $id][0]{
title,
summary,
talkTrack,
crmExternalId,
"product": product->name,
"proofPoints": proofPoints[]{title, url}
}
`, {id})
if (!play?.crmExternalId) {
return new Response('Missing crmExternalId', {status: 202})
}
const res = await fetch(
`https://api.gong.io/v2/crm/integrations/${process.env.GONG_CRM_INTEGRATION_ID}/objects/opportunity/records`,
{
method: 'POST',
headers: {
Authorization: `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
records: [{
id: play.crmExternalId,
fields: {
sanity_play_title: play.title,
sanity_play_summary: play.summary,
current_talk_track: play.talkTrack,
product: play.product,
approved_proof_points: play.proofPoints?.map((p: any) => p.title).join('; '),
},
}],
}),
}
)
if (!res.ok) throw new Error(`Gong API failed: ${res.status} ${await res.text()}`)
return Response.json({synced: true})
}How Sanity + Gong works
Build your Gong integration on Sanity
Use Sanity as the AI Content Operating System with structured content, real-time events, and flexible APIs for connecting approved sales content to Gong.
Start building free →CMS approaches to Gong
| Capability | Traditional CMS | Sanity |
|---|---|---|
| Sales content structure | Sales plays often live as pages or files, which makes field-level sync to Gong difficult. | Schema-as-code models sales plays, products, personas, proof points, and CRM IDs as connected JSON. |
| Publish-to-Gong timing | Updates often depend on manual copying or scheduled exports. | Webhooks or Functions can react to publish events and call Gong without polling. |
| Field selection for API payloads | Integrations may receive whole pages, rendered HTML, or file URLs. | GROQ can fetch the exact Gong payload in one query, including referenced products, segments, and proof points. |
| Editorial workflow for sales updates | Sales and marketing teams often work around rigid page workflows. | Sanity Studio supports custom workflows, Comments, Tasks, Content Releases, and scheduled publishing. |
| AI-ready sales operations | Unstructured pages make it harder for agents to answer deal-specific questions accurately. | Agent Context gives production AI agents scoped, schema-aware access to approved sales content. |
| Trade-offs | Simple for basic pages, but brittle for Gong field mapping. | You’ll need developer time for schemas and mapping, but the result is easier to version, test, and extend. |
Keep building
Explore related integrations to complete your content stack.
Sanity + Salesforce
Sync account, opportunity, and product content between Salesforce workflows and structured content in Sanity.
Sanity + HubSpot CRM
Connect campaign pages, lifecycle content, and sales enablement assets to HubSpot CRM records.
Sanity + Outreach
Feed approved messaging, snippets, and play content from Sanity into outbound sales workflows.